Cheetah Software
1.0
|
#include <SimControlPanel.h>
Public Member Functions | |
SimControlPanel (QWidget *parent=nullptr) | |
~SimControlPanel () | |
Private Slots | |
void | on_startButton_clicked () |
void | on_stopButton_clicked () |
void | on_joystickButton_clicked () |
void | on_driverButton_clicked () |
void | on_simulatorTable_cellChanged (int row, int column) |
void | on_saveSimulatorButton_clicked () |
void | on_loadSimulatorButton_clicked () |
void | on_robotTable_cellChanged (int row, int column) |
void | on_saveRobotButton_clicked () |
void | on_loadRobotButton_clicked () |
void | on_goHomeButton_clicked () |
void | on_kickButton_clicked () |
void | on_userControlTable_cellChanged (int row, int column) |
void | on_saveUserButton_clicked () |
void | on_loadUserButton_clicked () |
void | on_setTerrainButton_clicked () |
void | updateTerrainLabel () |
void | loadSimulationParameters (SimulatorControlParameters ¶ms) |
void | loadRobotParameters (RobotControlParameters ¶ms) |
void | loadUserParameters (ControlParameters ¶ms) |
Private Member Functions | |
void | updateUiEnable () |
Private Attributes | |
std::thread | _simThread |
bool | _started = false |
Ui::SimControlPanel * | ui |
Simulation * | _simulation = nullptr |
PeriodicTaskManager * | _interfaceTaskManager = nullptr |
RobotInterface * | _robotInterface = nullptr |
Graphics3D * | _graphicsWindow = nullptr |
SimulatorControlParameters | _parameters |
ControlParameters | _userParameters |
bool | _simulationMode = false |
bool | _firstStart = true |
bool | _ignoreTableCallbacks = false |
bool | _loadedUserSettings = false |
std::string | _terrainFileName |
Definition at line 23 of file SimControlPanel.h.
|
explicit |
Init sim window
Definition at line 45 of file SimControlPanel.cpp.
References _loadedUserSettings, _parameters, _userParameters, DEFAULT_USER_FILE, ControlParameters::defineAndInitializeFromYamlFile(), ControlParameters::generateUnitializedList(), getConfigDirectoryPath(), ControlParameters::initializeFromYamlFile(), ControlParameters::isFullyInitialized(), loadSimulationParameters(), loadUserParameters(), SIMULATOR_DEFAULT_PARAMETERS, ui, updateTerrainLabel(), and updateUiEnable().
SimControlPanel::~SimControlPanel | ( | ) |
Definition at line 87 of file SimControlPanel.cpp.
References _graphicsWindow, _interfaceTaskManager, _robotInterface, _simulation, and ui.
|
privateslot |
Populate the robot qtable parameters
Definition at line 219 of file SimControlPanel.cpp.
References _ignoreTableCallbacks, ui, and updateQtableWithParameters().
|
privateslot |
Populate the simulator qtable parameters
Definition at line 209 of file SimControlPanel.cpp.
References _ignoreTableCallbacks, ui, and updateQtableWithParameters().
|
privateslot |
Populate the robot qtable parameters
Definition at line 228 of file SimControlPanel.cpp.
References _ignoreTableCallbacks, ui, and updateQtableWithParameters().
|
privateslot |
Definition at line 241 of file SimControlPanel.cpp.
|
privateslot |
Definition at line 577 of file SimControlPanel.cpp.
References _simulation, FBModelState< T >::bodyOrientation, FBModelState< T >::bodyPosition, FBModelState< T >::bodyVelocity, FBModelState< T >::q, FBModelState< T >::qd, and Simulation::setRobotState().
|
privateslot |
Attempt to reset the joystick if a new one is connected
Definition at line 237 of file SimControlPanel.cpp.
References _graphicsWindow, and Graphics3D::resetGameController().
|
privateslot |
Definition at line 590 of file SimControlPanel.cpp.
References _simulation, FBModelState< T >::bodyVelocity, Simulation::getRobotState(), Simulation::setRobotState(), and ui.
|
privateslot |
Definition at line 407 of file SimControlPanel.cpp.
References ControlParameterCollection::_map, _robotInterface, _simulation, _simulationMode, ControlParameterCollection::checkIfAllSet(), ControlParameterCollection::clearAllSet(), ControlParameters::collection, createErrorMessage(), ControlParameters::generateUnitializedList(), RobotInterface::getParams(), Simulation::getRobotParams(), ControlParameters::initializeFromYamlFile(), Simulation::isRobotConnected(), loadRobotParameters(), ControlParameters::lockMutex(), RobotInterface::sendControlParameter(), Simulation::sendControlParameter(), and ControlParameters::unlockMutex().
|
privateslot |
Load simulation config from file
Definition at line 319 of file SimControlPanel.cpp.
References _parameters, ControlParameterCollection::checkIfAllSet(), ControlParameterCollection::clearAllSet(), ControlParameters::collection, createErrorMessage(), ControlParameters::generateUnitializedList(), ControlParameters::initializeFromYamlFile(), loadSimulationParameters(), and ControlParameters::unlockMutex().
|
privateslot |
Definition at line 533 of file SimControlPanel.cpp.
References _loadedUserSettings, ControlParameterCollection::_map, _robotInterface, _simulation, _simulationMode, _started, _userParameters, ControlParameters::collection, createErrorMessage(), ControlParameters::defineAndInitializeFromYamlFile(), ControlParameterCollection::deleteAll(), Simulation::isRobotConnected(), loadUserParameters(), ControlParameters::lockMutex(), RobotInterface::sendControlParameter(), Simulation::sendControlParameter(), and ControlParameters::unlockMutex().
|
privateslot |
Definition at line 340 of file SimControlPanel.cpp.
References _ignoreTableCallbacks, _robotInterface, _simulation, _simulationMode, RobotInterface::getParams(), Simulation::getRobotParams(), Simulation::isRobotConnected(), RobotInterface::sendControlParameter(), Simulation::sendControlParameter(), and ui.
|
privateslot |
Definition at line 397 of file SimControlPanel.cpp.
References _simulation, createErrorMessage(), Simulation::getRobotParams(), and ControlParameters::writeToYamlFile().
|
privateslot |
Save simulation config to file
Definition at line 303 of file SimControlPanel.cpp.
References _parameters, createErrorMessage(), ControlParameters::lockMutex(), ControlParameters::unlockMutex(), and ControlParameters::writeToYamlFile().
|
privateslot |
Definition at line 567 of file SimControlPanel.cpp.
References _userParameters, createErrorMessage(), and ControlParameters::writeToYamlFile().
|
privateslot |
Definition at line 460 of file SimControlPanel.cpp.
References _terrainFileName, createErrorMessage(), and updateTerrainLabel().
|
privateslot |
Respond to a change in the simulator table.
Definition at line 246 of file SimControlPanel.cpp.
References _ignoreTableCallbacks, ControlParameter::_kind, _parameters, ControlParameters::collection, ControlParameterCollection::lookup(), ControlParameter::toString(), and ui.
|
privateslot |
Start a simulation/robot run
Definition at line 116 of file SimControlPanel.cpp.
References _graphicsWindow, _interfaceTaskManager, _parameters, _robotInterface, _simThread, _simulation, _simulationMode, _started, _terrainFileName, _userParameters, CHEETAH_3, createErrorMessage(), RobotInterface::getParams(), Simulation::getRobotParams(), Simulation::getSimParams(), loadRobotParameters(), loadSimulationParameters(), Simulation::loadTerrainFile(), MINI_CHEETAH, Simulation::runAtSpeed(), Graphics3D::setAnimating(), RobotInterface::startInterface(), ui, and updateUiEnable().
|
privateslot |
Stop the currently running simulation or robot connection
Definition at line 177 of file SimControlPanel.cpp.
References _graphicsWindow, _interfaceTaskManager, _robotInterface, _simThread, _simulation, _started, Graphics3D::setAnimating(), Simulation::stop(), RobotInterface::stopInterface(), and updateUiEnable().
|
privateslot |
Definition at line 472 of file SimControlPanel.cpp.
References _ignoreTableCallbacks, ControlParameter::_kind, _robotInterface, _simulation, _simulationMode, _started, _userParameters, ControlParameters::collection, Simulation::isRobotConnected(), ControlParameterCollection::lookup(), RobotInterface::sendControlParameter(), Simulation::sendControlParameter(), and ui.
|
privateslot |
Update the name of the loaded terrain file label
Definition at line 109 of file SimControlPanel.cpp.
References _terrainFileName, and ui.
|
private |
Enable/disable buttons as needed based on what is running
Definition at line 98 of file SimControlPanel.cpp.
|
private |
Definition at line 83 of file SimControlPanel.h.
|
private |
Definition at line 79 of file SimControlPanel.h.
|
private |
Definition at line 84 of file SimControlPanel.h.
|
private |
Definition at line 77 of file SimControlPanel.h.
|
private |
Definition at line 85 of file SimControlPanel.h.
|
private |
Definition at line 80 of file SimControlPanel.h.
|
private |
Definition at line 78 of file SimControlPanel.h.
|
private |
Definition at line 73 of file SimControlPanel.h.
|
private |
Definition at line 76 of file SimControlPanel.h.
|
private |
Definition at line 82 of file SimControlPanel.h.
|
private |
Definition at line 74 of file SimControlPanel.h.
|
private |
Definition at line 86 of file SimControlPanel.h.
|
private |
Definition at line 81 of file SimControlPanel.h.
|
private |
Definition at line 75 of file SimControlPanel.h.