Cheetah Software
1.0
|
#include <SimulationBridge.h>
Public Member Functions | |
SimulationBridge (RobotType robot, RobotController *robot_ctrl) | |
void | run () |
void | handleControlParameters () |
void | runRobotControl () |
~SimulationBridge () | |
void | run_sbus () |
Private Attributes | |
PeriodicTaskManager | taskManager |
bool | _firstControllerRun = true |
PeriodicTaskManager * | _fakeTaskManager = nullptr |
RobotType | _robot |
RobotRunner * | _robotRunner = nullptr |
SimulatorMode | _simMode |
SharedMemoryObject< SimulatorSyncronizedMessage > | _sharedMemory |
RobotControlParameters | _robotParams |
ControlParameters * | _userParams = nullptr |
u64 | _iterations = 0 |
std::thread * | sbus_thread |
Definition at line 18 of file SimulationBridge.h.
|
inlineexplicit |
Definition at line 20 of file SimulationBridge.h.
References _fakeTaskManager, _robotRunner, _userParams, RobotController::getUserControlParameters(), handleControlParameters(), run(), and runRobotControl().
|
inline |
Definition at line 30 of file SimulationBridge.h.
References _fakeTaskManager, _robotRunner, and run_sbus().
void SimulationBridge::handleControlParameters | ( | ) |
This function handles a a control parameter message from the simulator
Definition at line 71 of file SimulationBridge.cpp.
References ControlParameter::_kind, ControlParameterCollection::_map, _robotParams, _sharedMemory, _userParams, ControlParameters::collection, controlParameterValueKindToString(), ControlParameter::get(), GET_ROBOT_PARAM_BY_NAME, ControlParameterCollection::lookup(), ControlParameterRequest::name, ControlParameterResponse::name, ControlParameterResponse::nParameters, ControlParameterRequest::parameterKind, ControlParameterResponse::parameterKind, ControlParameterRequest::requestKind, ControlParameterResponse::requestKind, ControlParameterRequest::requestNumber, ControlParameterResponse::requestNumber, ControlParameter::set(), SET_ROBOT_PARAM_BY_NAME, SET_USER_PARAM_BY_NAME, ControlParameterResponse::toString(), ControlParameterRequest::value, and ControlParameterResponse::value.
void SimulationBridge::run | ( | ) |
Definition at line 13 of file SimulationBridge.cpp.
References _iterations, _robot, _sharedMemory, _simMode, SharedMemoryObject< T >::attach(), DEVELOPMENT_SIMULATOR_SHARED_MEMORY_NAME, DO_NOTHING, EXIT, handleControlParameters(), RUN_CONTROL_PARAMETERS, RUN_CONTROLLER, and runRobotControl().
void SimulationBridge::run_sbus | ( | ) |
Definition at line 242 of file SimulationBridge.cpp.
References init_sbus(), receive_sbus(), and sbus_packet_complete().
void SimulationBridge::runRobotControl | ( | ) |
Definition at line 186 of file SimulationBridge.cpp.
References _firstControllerRun, ControlParameterCollection::_map, _robot, RobotRunner::_robot_ctrl, _robotParams, _robotRunner, _sharedMemory, _simMode, RobotRunner::cheaterState, RobotRunner::cheetahMainVisualization, ControlParameters::collection, RobotRunner::controlParameters, RobotRunner::driverCommand, ControlParameters::generateUnitializedList(), RobotController::getUserControlParameters(), RobotRunner::init(), ControlParameters::isFullyInitialized(), RobotRunner::robotType, RobotRunner::run(), RUN_CONTROLLER, run_sbus(), sbus_thread, RobotRunner::spiCommand, RobotRunner::spiData, RobotRunner::tiBoardCommand, RobotRunner::tiBoardData, RobotRunner::vectorNavData, and RobotRunner::visualizationData.
|
private |
Definition at line 39 of file SimulationBridge.h.
|
private |
Definition at line 38 of file SimulationBridge.h.
|
private |
Definition at line 46 of file SimulationBridge.h.
|
private |
Definition at line 40 of file SimulationBridge.h.
|
private |
Definition at line 44 of file SimulationBridge.h.
|
private |
Definition at line 41 of file SimulationBridge.h.
|
private |
Definition at line 43 of file SimulationBridge.h.
|
private |
Definition at line 42 of file SimulationBridge.h.
|
private |
Definition at line 45 of file SimulationBridge.h.
|
private |
Definition at line 48 of file SimulationBridge.h.
|
private |
Definition at line 37 of file SimulationBridge.h.