![]() |
An open-source, flexible 3D physical simulation framework
|
The class to log all data. More...
#include <Controller.h>
Public Member Functions | |
Controller (interfaces::sReal rate, const std::vector< SimMotor *> &motors, const std::vector< interfaces::BaseSensor *> &sensors, const std::vector< interfaces::NodeData *> &sNodes, interfaces::ControlCenter *control, int portn=1500) | |
virtual | ~Controller (void) |
virtual void | update (interfaces::sReal time_ms) |
virtual std::list< interfaces::sReal > | getSensorValues (void) |
void | handleError (void) |
void | setID (unsigned long id) |
unsigned long | getID (void) const |
const interfaces::ControllerData | getSController () const |
void | getCoreExchange (interfaces::core_objects_exchange *obj) const |
void | resetData (void) |
void | setDylibPath (const std::string &dylib_path) |
void | setAutoMode (bool mode) |
void | setIP (const std::string &ip) |
void | setPort (int port) |
bool | getAutoMode (void) const |
const std::string | getIP (void) const |
int | getPort (void) const |
void | connect (void) |
void | disconnect (void) |
![]() | |
Thread () | |
virtual | ~Thread () |
void | start () |
Starts the execution of this Thread. More... | |
void | cancel (bool block=false) |
Tries to cancel the Thread. More... | |
void | setCancellationPoint () |
Adds a cancellation point to your run method. More... | |
bool | wait () |
stops execution until the thread has finished. More... | |
bool | join () |
bool | wait (unsigned long timeoutMilliseconds) |
puts the Thread to sleep for a specified amount of time. More... | |
bool | isRunning () const |
returns true if the Thread is running. More... | |
bool | isFinished () const |
void | setStackSize (std::size_t stackSize) |
std::size_t | getStackSize () const |
bool | isCurrentThread () const |
Protected Member Functions | |
int | initServer (int port) |
void | getClient (void) |
int | openClient (const char *host, int port) |
int | connectClient (void) |
int | getSReal (const char *data, interfaces::sReal *value) const |
int | getChar (const char *data, char *c) const |
void | run (void) |
The thread will execute this method once it has been started . More... | |
Protected Attributes | |
int | server |
int | conn |
void * | dy |
interfaces::ControllerData | sController |
interfaces::ControllerInterface * | dylibController |
interfaces::sReal | count_ms |
bool | auto_connect |
int | connected |
int | nport |
int | sock_state |
struct sockaddr_in * | myServAddr |
std::string | hostname |
interfaces::ControlCenter * | control |
bool | running |
std::vector< SimMotor * > | motors |
std::vector< interfaces::BaseSensor * > | sensors |
std::vector< interfaces::NodeData * > | sNodes |
Additional Inherited Members | |
![]() | |
static Thread * | getCurrentThread () |
static void | cancelAll (bool block=false) |
![]() | |
static void | msleep (unsigned long msec) |
causes the current thread to sleep for More... | |
The class to log all data.
Definition at line 67 of file Controller.h.
mars::sim::Controller::Controller | ( | interfaces::sReal | rate, |
const std::vector< SimMotor *> & | motors, | ||
const std::vector< interfaces::BaseSensor *> & | sensors, | ||
const std::vector< interfaces::NodeData *> & | sNodes, | ||
interfaces::ControlCenter * | control, | ||
int | portn = 1500 |
||
) |
Definition at line 58 of file Controller.cpp.
|
virtual |
Definition at line 114 of file Controller.cpp.
void mars::sim::Controller::connect | ( | void | ) |
Definition at line 1038 of file Controller.cpp.
|
protected |
Definition at line 978 of file Controller.cpp.
void mars::sim::Controller::disconnect | ( | void | ) |
Definition at line 1043 of file Controller.cpp.
bool mars::sim::Controller::getAutoMode | ( | void | ) | const |
Definition at line 1026 of file Controller.cpp.
|
protected |
Definition at line 796 of file Controller.cpp.
|
protected |
Definition at line 911 of file Controller.cpp.
void mars::sim::Controller::getCoreExchange | ( | interfaces::core_objects_exchange * | obj | ) | const |
Definition at line 149 of file Controller.cpp.
unsigned long mars::sim::Controller::getID | ( | void | ) | const |
Definition at line 141 of file Controller.cpp.
const std::string mars::sim::Controller::getIP | ( | void | ) | const |
Definition at line 1030 of file Controller.cpp.
int mars::sim::Controller::getPort | ( | void | ) | const |
Definition at line 1034 of file Controller.cpp.
const ControllerData mars::sim::Controller::getSController | ( | void | ) | const |
Definition at line 145 of file Controller.cpp.
|
virtual |
Definition at line 1047 of file Controller.cpp.
|
protected |
Definition at line 776 of file Controller.cpp.
void mars::sim::Controller::handleError | ( | void | ) |
Definition at line 822 of file Controller.cpp.
|
protected |
Definition at line 885 of file Controller.cpp.
|
protected |
Definition at line 933 of file Controller.cpp.
void mars::sim::Controller::resetData | ( | void | ) |
Definition at line 804 of file Controller.cpp.
|
protectedvirtual |
The thread will execute this method once it has been started .
Implements mars::utils::Thread.
Definition at line 996 of file Controller.cpp.
void mars::sim::Controller::setAutoMode | ( | bool | mode | ) |
Definition at line 1014 of file Controller.cpp.
void mars::sim::Controller::setDylibPath | ( | const std::string & | dylib_path | ) |
Definition at line 829 of file Controller.cpp.
void mars::sim::Controller::setID | ( | unsigned long | id | ) |
Definition at line 137 of file Controller.cpp.
void mars::sim::Controller::setIP | ( | const std::string & | ip | ) |
Definition at line 1018 of file Controller.cpp.
void mars::sim::Controller::setPort | ( | int | port | ) |
Definition at line 1022 of file Controller.cpp.
|
virtual |
Definition at line 154 of file Controller.cpp.
|
protected |
Definition at line 112 of file Controller.h.
|
protected |
Definition at line 106 of file Controller.h.
|
protected |
Definition at line 113 of file Controller.h.
|
protected |
Definition at line 118 of file Controller.h.
|
protected |
Definition at line 111 of file Controller.h.
|
protected |
Definition at line 107 of file Controller.h.
|
protected |
Definition at line 110 of file Controller.h.
|
protected |
Definition at line 117 of file Controller.h.
|
protected |
Definition at line 120 of file Controller.h.
|
protected |
Definition at line 116 of file Controller.h.
|
protected |
Definition at line 114 of file Controller.h.
|
protected |
Definition at line 119 of file Controller.h.
|
protected |
Definition at line 109 of file Controller.h.
|
protected |
Definition at line 121 of file Controller.h.
|
protected |
Definition at line 105 of file Controller.h.
|
protected |
Definition at line 122 of file Controller.h.
|
protected |
Definition at line 115 of file Controller.h.