Cheetah Software
1.0
|
#include <RobotInterface.h>
Public Member Functions | |
EIGEN_MAKE_ALIGNED_OPERATOR_NEW | RobotInterface (RobotType robotType, Graphics3D *gfx, PeriodicTaskManager *tm, ControlParameters &userParameters) |
RobotControlParameters & | getParams () |
void | startInterface () |
void | stopInterface () |
void | lcmHandler () |
void | sendControlParameter (const std::string &name, ControlParameterValue value, ControlParameterValueKind kind, bool isUser) |
void | handleControlParameter (const lcm::ReceiveBuffer *rbuf, const std::string &chan, const control_parameter_respones_lcmt *msg) |
void | handleVisualizationData (const lcm::ReceiveBuffer *rbuf, const std::string &chan, const cheetah_visualization_lcmt *msg) |
void | init () |
void | run () |
void | cleanup () |
virtual | ~RobotInterface () |
Private Attributes | |
PeriodicTaskManager | _taskManager |
gamepad_lcmt | _gamepad_lcmt |
control_parameter_request_lcmt | _parameter_request_lcmt |
bool | _pendingControlParameterSend = false |
lcm::LCM | _lcm |
uint64_t | _robotID |
std::thread | _lcmThread |
VisualizationData | _visualizationData |
RobotControlParameters | _controlParameters |
ControlParameters & | _userParameters |
Graphics3D * | _gfx |
RobotType | _robotType |
bool | _running = false |
std::mutex | _lcmMutex |
std::condition_variable | _lcmCV |
bool | _waitingForLcmResponse = false |
bool | _lcmResponseBad = true |
Quadruped< double > | _quadruped |
FloatingBaseModel< double > | _model |
DynamicsSimulator< double > * | _simulator = nullptr |
FBModelState< double > | _fwdKinState |
Additional Inherited Members | |
Private Member Functions inherited from PeriodicTask | |
PeriodicTask (PeriodicTaskManager *taskManager, float period, std::string name) | |
void | start () |
void | stop () |
void | printStatus () |
void | clearMax () |
bool | isSlow () |
virtual | ~PeriodicTask () |
float | getPeriod () |
float | getRuntime () |
float | getMaxPeriod () |
float | getMaxRuntime () |
Definition at line 26 of file RobotInterface.h.
RobotInterface::RobotInterface | ( | RobotType | robotType, |
Graphics3D * | gfx, | ||
PeriodicTaskManager * | tm, | ||
ControlParameters & | userParameters | ||
) |
Definition at line 8 of file RobotInterface.cpp.
References _controlParameters, Graphics3D::_drawList, _fwdKinState, _gfx, DrawList::_kinematicXform, _lcm, _model, _parameter_request_lcmt, _quadruped, _robotID, _robotType, _simulator, DrawList::_visualizationData, _visualizationData, DrawList::addCheckerboard(), DrawList::buildDrawList(), Quadruped< T >::buildModel(), CHEETAH_3, CHEETAH_3_DEFAULT_PARAMETERS, ControlParameters::generateUnitializedList(), getConfigDirectoryPath(), handleControlParameter(), handleVisualizationData(), ControlParameters::initializeFromYamlFile(), ControlParameters::isFullyInitialized(), MINI_CHEETAH, MINI_CHEETAH_DEFAULT_PARAMETERS, FBModelState< T >::q, FBModelState< T >::qd, RobotRunner::robotType, Graphics3D::setupCheetah3(), Graphics3D::setupMiniCheetah(), and DrawList::updateCheckerboard().
|
inlinevirtual |
Definition at line 50 of file RobotInterface.h.
References _simulator, and PeriodicTask::stop().
|
inlinevirtual |
|
inline |
Definition at line 31 of file RobotInterface.h.
References _controlParameters, handleControlParameter(), handleVisualizationData(), lcmHandler(), sendControlParameter(), startInterface(), and stopInterface().
void RobotInterface::handleControlParameter | ( | const lcm::ReceiveBuffer * | rbuf, |
const std::string & | chan, | ||
const control_parameter_respones_lcmt * | msg | ||
) |
Definition at line 152 of file RobotInterface.cpp.
References _lcmCV, _lcmMutex, _lcmResponseBad, _parameter_request_lcmt, and _waitingForLcmResponse.
void RobotInterface::handleVisualizationData | ( | const lcm::ReceiveBuffer * | rbuf, |
const std::string & | chan, | ||
const cheetah_visualization_lcmt * | msg | ||
) |
Definition at line 64 of file RobotInterface.cpp.
References _fwdKinState, _simulator, FBModelState< T >::bodyOrientation, FBModelState< T >::bodyPosition, DynamicsSimulator< T >::forwardKinematics(), FBModelState< T >::q, and DynamicsSimulator< T >::setState().
|
inlinevirtual |
Implements PeriodicTask.
Definition at line 47 of file RobotInterface.h.
References run().
void RobotInterface::lcmHandler | ( | ) |
Definition at line 202 of file RobotInterface.cpp.
References _lcm, and _running.
|
virtual |
Implements PeriodicTask.
Definition at line 85 of file RobotInterface.cpp.
References Graphics3D::_drawList, _gamepad_lcmt, _gfx, _lcm, _robotID, _simulator, GamepadCommand::get(), Graphics3D::getDriverCommand(), INTERFACE_LCM_NAME, and DrawList::updateRobotFromModel().
void RobotInterface::sendControlParameter | ( | const std::string & | name, |
ControlParameterValue | value, | ||
ControlParameterValueKind | kind, | ||
bool | isUser | ||
) |
Definition at line 96 of file RobotInterface.cpp.
References _lcm, _lcmCV, _lcmMutex, _lcmResponseBad, _parameter_request_lcmt, _pendingControlParameterSend, _waitingForLcmResponse, controlParameterValueToString(), SET_ROBOT_PARAM_BY_NAME, SET_USER_PARAM_BY_NAME, and TIMES_TO_RESEND_CONTROL_PARAM.
void RobotInterface::startInterface | ( | ) |
Definition at line 176 of file RobotInterface.cpp.
References _controlParameters, _lcmThread, ControlParameterCollection::_map, _running, _userParameters, ControlParameters::collection, lcmHandler(), sendControlParameter(), and PeriodicTask::start().
void RobotInterface::stopInterface | ( | ) |
Definition at line 193 of file RobotInterface.cpp.
References _lcmThread, _running, _taskManager, and PeriodicTaskManager::stopAll().
|
private |
Definition at line 64 of file RobotInterface.h.
|
private |
Definition at line 79 of file RobotInterface.h.
|
private |
Definition at line 57 of file RobotInterface.h.
|
private |
Definition at line 66 of file RobotInterface.h.
|
private |
Definition at line 60 of file RobotInterface.h.
|
private |
Definition at line 71 of file RobotInterface.h.
|
private |
Definition at line 70 of file RobotInterface.h.
|
private |
Definition at line 73 of file RobotInterface.h.
|
private |
Definition at line 62 of file RobotInterface.h.
|
private |
Definition at line 77 of file RobotInterface.h.
|
private |
Definition at line 58 of file RobotInterface.h.
|
private |
Definition at line 59 of file RobotInterface.h.
|
private |
Definition at line 76 of file RobotInterface.h.
|
private |
Definition at line 61 of file RobotInterface.h.
|
private |
Definition at line 67 of file RobotInterface.h.
|
private |
Definition at line 68 of file RobotInterface.h.
|
private |
Definition at line 78 of file RobotInterface.h.
|
private |
Definition at line 56 of file RobotInterface.h.
|
private |
Definition at line 65 of file RobotInterface.h.
|
private |
Definition at line 63 of file RobotInterface.h.
|
private |
Definition at line 72 of file RobotInterface.h.