mc_rtc::Configuration
general purpose configurationRegardless of the interface you use, general options for mc_rtc are provided through the configuration files present on your system. Morever, some interfaces will let you specify another configuration file (often on the command line).
This section covers both the different location where it might be loaded from as well as the main options that can be used in the file.
The following two files will be systematically read by mc_rtc (if they exist):
$INSTALL_PREFIX/etc/mc_rtc.yaml
$HOME/.config/mc_rtc/mc_rtc.yaml
%APPDATA%/mc_rtc/mc_rtc.yaml
The interface might load additional configuration file(s). Please refer to the interface documentation to find out about that.
Entry | Description | Example/Default |
---|---|---|
Main entries |
These entries cover most needs you might have | |
MainRobot | This entry dictates the main robot used by all controllers. Most interface cannot infer the correct module to use based on the simulation environment so this is the user's responsibility to make sure the two match. |
or |
Enabled | Provides a list of enabled controllers. See the list of all available sample controllers. | |
Default | Select which of the enabled controllers will be started first. Note that if the default controller is not enabled or if no default entry is provided then the first enabled controller in the list is chosen as a default controller. | |
Timestep | The controller's timestep. | |
Log | Dictate whether or not controllers will log their output. | |
InitAttitudeFromSensor | Intialize the robot's attitude from sensor or the robot module | |
InitAttitudeSensor | Name of the BodySensor used for initialization of the robot's attitude. An empty name uses the default body sensor. Only used when InitAttitudeFromSensor=true |
|
Logging options |
The following options affect the way mc_rtc deals with controller activity logging. They have no effect if logging is disabled. | |
LogDirectory | This option dictates where the log files will be stored, defaults to a system temporary directory | |
LogTemplate | This option dictates the prefix of the log. The log file will then have the name: [LogTemplate]-[ControllerName]-[date].log |
|
LogPolicy | This option dictates whether logging-related disk operations happen in a separate thread ("threaded") or in the same thread as the run() loop ("non-threaded"). This defaults to the non-threaded policy. On real-time systems, the threaded policy is strongly advised. | |
Module loading options |
The following options control the way mc_rtc loads additional modules from libraries (controllers, robot modules, observers, plugins). | |
ControllerModulePaths | This option allow you to specify additional directories where mc_rtc will look for controller modules. | |
RobotModulePaths | This option allow you to specify additional directories where mc_rtc will look for robot modules. | |
ObserverModulePaths | This option allow you to specify additional directories where mc_rtc will look for state observation modules. | |
GlobalPluginPaths | This option allow you to specify additional directories where mc_rtc will look for global plugins. |
The following two files will be systematically read by mc_rtc (if they exist):
${MC_PLUGINS_RUNTIME_INSTALL_PREFIX}/etc/ROS.yaml
$HOME/.config/mc_rtc/plugins/ROS.yaml
%APPDATA%/mc_rtc/plugins/ROS.yaml
The following table describes each possible sections in the ROS plugin configuration and their possible entries.
Entry | Description | Example/Default |
---|---|---|
publish entries |
The following options only affect the publication of the robot's state in ROS. | |
control | Publish the robot's control state (mc_rtc controller output). | |
env | Publish other robots control state (mc_rtc controller output for the non-main robot). | |
real | Publish the robot's observed state (i.e. the robot's state obtained from the observer pipeline). | |
timestep | Control the publication rate of the robot's controlled and real state. |
For a given controller NAME
, the following configuration files are loaded:
${NAME_RUNTIME_LOCATION}/etc/${NAME}.yaml
${HOME}/.config/mc_rtc/controllers/${NAME}.yaml
%APPDATA%/mc_rtc/controllers/%NAME%.yaml
The configuration loaded from those files is available in the configuration
parameter of the controller constructor. You can check the mc_rtc::Configuration
general purpose configuration tutorial for more information on the configuration object.
Controller can also access a robot's specific configuration — for example to set specific gains.
For a given controller NAME
and a given robot's module named ROBOT
, the following configuration files are loaded:
${NAME_RUNTIME_LOCATION}/${NAME}/${ROBOT}.yaml
${HOME}/.config/mc_rtc/controllers/${NAME}/${ROBOT}.yaml
%APPDATA%/mc_rtc/controllers/%NAME%/%ROBOT%.yaml
By default, these configuration files are automatically loaded into the
robotssection of the controller's configuration, under each robot's module name. This behavior can be disabled or modified through
mc_control::ControllerParameters
that are given to the controller constructor.
These configurations can also be accessed via the mc_control::MCController::robot_config(const mc_rbdyn::Robot & robot)
method and its overload mc_control::MCController::robot_config(const std::string & name)
.