|
moveit2
The MoveIt Motion Planning Framework for ROS 2.
|

To run the Setup Assistant
ros2 run moveit_setup_assistant moveit_setup_assistant
To run the collision updater:
ros2 run moveit_setup_assistant moveit_setup_assistant --urdf <path_to_urdf/xacro> --xacro-args <optional_xacro_args> --srdf <path_to_srdf> --trials 100000
There are four main goals with this refactored version of MoveIt Setup Assistant (MSA).
To that end the functionality has been split into multiple packages, using a pluginlib-based class structure.
There are four primary classes.
Contains all of the non-GUI code necessary for doing one "screen" worth of setup. The interface contains two methods to implement:
Keeping the GUI code separate from the business logic, the widget here is implemented with QT. There's one widget for each SetupStep. The widgets are also configured so that they can be loaded via pluginlib.
Each widget has access to the RVizPanel, a common visual panel for displaying the robot itself.
The interface is comprised of
The widgets can emit three Q_SIGNALS:
SetupConfigs are where all the data for each part of the configuration is stored in code. Collectively, all the configs are a replacement for the massive MoveItConfigData class in MSA 1.0.
In the config package (i.e. on the filesystem), data can be stored in one of two places.
The interface for SetupConfig:
Each of the SetupConfigs exist as singletons, managed by the DataWarehouse object. The configs are loaded via pluginlib so that the arbitrary new configs can be added and common operations can be run on all configs. Generically, the configs can be retrieved with
SetupConfigPtr get(string config_name, string config_class)
This returns a shared pointer to the generic SetupConfig with the given name. The config_class specifies how to load it with pluginlib. For conciseness, config_class has an empty default value, and you can register a class to be used with a given name.
For additional syntactic sugar, you can also specify the class via template and get back a pointer to the specific SetupConfig class, i.e.
config_data_->get<URDFConfig>("urdf")
This class is a container for the logic for a single file to appear in MoveIt configuration package.
The collectFiles method of SetupConfig allows us to specify all of the files we'd like to generate relative to a specific SetupConfig. There can be any number of files generated (zero, one or many) for each config.
There are also two methods which depend on the implementations of the above methods.
The status can be in one of five (5) states, as specified by the FileStatus enum.
Checking for external modification depends on the timestamps of the written files, which is why collectFiles and the constructor for GeneratedFile require passing in the timestamp of the last package generation.
Note it may be useful to call moveit_setup::createParentFolders before writing.
There is also YamlGeneratedFile as an easy abstraction of generating a YAML file. The write method is already implemented, and instead writeYaml must be implemented.
One additional special type of GeneratedFile is TemplatedGeneratedFile which generates a text file from a common template. The write method is already written, and instead you simply must specify the full path to the template via getTemplatePath. The file will be generated as a copy of the template but using the values of TemplateVariables inserted in the proper locations. The TemplateVariables are collected via SetupConfig::collectVariables.
The format for the templates is custom to MSA. Let's assume you have a TemplateVariable with key=GENERATED_PACKAGE_NAME and value=r2d2_moveit_config. The key surrounded by square brackets will be replaced with the value. For example,
<name>[GENERATED_PACKAGE_NAME]</name>
becomes
<name>r2d2_moveit_config</name>