moveit2
The MoveIt Motion Planning Framework for ROS 2.
Classes | Public Member Functions | Protected Member Functions | Protected Attributes | List of all members
moveit_setup::controllers::ControlXacroConfig Class Reference

#include <control_xacro_config.hpp>

Inheritance diagram for moveit_setup::controllers::ControlXacroConfig:
Inheritance graph
[legend]
Collaboration diagram for moveit_setup::controllers::ControlXacroConfig:
Collaboration graph
[legend]

Classes

class  GeneratedControlHeader
 
class  GeneratedInitialPositions
 

Public Member Functions

void loadFromDescription ()
 Load the original command interfaces from the original (unmodified) URDF. More...
 
bool hasAllControlTagsInOriginal () const
 
std::string getJointsXML () const
 Return the additional joint xml needed for ros2_control tags. More...
 
void collectFiles (const std::filesystem::path &package_path, const GeneratedTime &last_gen_time, std::vector< GeneratedFilePtr > &files) override
 Collect the files generated by this configuration and add them to the vector. More...
 
void collectVariables (std::vector< TemplateVariable > &variables) override
 Collect key/value pairs for use in templates. More...
 
SetupConfig overrides
void onInit () override
 Overridable initialization method. More...
 
void loadPrevious (const std::filesystem::path &, const YAML::Node &node) override
 Loads the configuration from an existing MoveIt configuration. More...
 
YAML::Node saveToYaml () const override
 Optionally save "meta" information for saving in the .setup_assistant yaml file. More...
 
bool isConfigured () const override
 Return true if this part of the configuration is completely set up. More...
 
IncludedXacroConfig overrides
std::string getFilepath () const override
 The file path to use in the <xacro:include> tag. More...
 
bool hasChanges () const override
 Returns if the xacro and its properties have changed, resulting in the whole urdf needing regeneration. More...
 
std::vector< std::pair< std::string, std::string > > getArguments () const override
 Returns a list of name/value pairs for arguments that the modified urdf should have. More...
 
std::vector< std::string > getCommands () const override
 Return a list of additional commands that need to be inserted after the xacro is included. More...
 
Data access and modification
const ControlInterfacesgetAvailableControlInterfaces () const
 
const ControlInterfacesgetDefaultControlInterfaces () const
 
void setControlInterfaces (const ControlInterfaces &ci)
 Use the specified controller interfaces for all the lacking joints. More...
 
const ControlInterfaces getControlInterfaces (const std::vector< std::string > &joint_names) const
 Get all the control interfaces for all of the specified joint names. More...
 
- Public Member Functions inherited from moveit_setup::IncludedXacroConfig
void onInit () override
 Overridable initialization method. More...
 
- Public Member Functions inherited from moveit_setup::SetupConfig
 SetupConfig ()=default
 
 SetupConfig (const SetupConfig &)=default
 
 SetupConfig (SetupConfig &&)=default
 
SetupConfigoperator= (const SetupConfig &)=default
 
SetupConfigoperator= (SetupConfig &&)=default
 
virtual ~SetupConfig ()=default
 
void initialize (const std::shared_ptr< DataWarehouse > &config_data, const rclcpp::Node::SharedPtr &parent_node, const std::string &name)
 Called after construction to initialize the step. More...
 
const std::string & getName ()
 The name for this part of the configuration. More...
 
virtual void collectDependencies (std::set< std::string > &) const
 Collect the package dependencies generated by this configuration. More...
 

Protected Member Functions

void getControlInterfaces (const std::string &joint_name, ControlInterfaces &ci) const
 

Protected Attributes

std::vector< std::string > joint_names_
 
std::unordered_map< std::string, ControlInterfacesoriginal_joint_interfaces_
 A list of all joints used by the current SRDF groups. More...
 
std::unordered_map< std::string, ControlInterfacesnew_joint_interfaces_
 
ControlInterfaces default_ci_
 
ControlInterfaces available_ci_
 
srdf::Model::GroupState initial_group_state_
 
bool changed_
 
- Protected Attributes inherited from moveit_setup::IncludedXacroConfig
std::shared_ptr< URDFConfigurdf_config_
 
- Protected Attributes inherited from moveit_setup::SetupConfig
std::shared_ptr< DataWarehouseconfig_data_
 
rclcpp::Node::SharedPtr parent_node_
 
std::string name_
 
std::shared_ptr< rclcpp::Logger > logger_
 

Additional Inherited Members

- Public Types inherited from moveit_setup::IncludedXacroConfig
using Ptr = std::shared_ptr< IncludedXacroConfig >
 

Detailed Description

Definition at line 57 of file control_xacro_config.hpp.

Member Function Documentation

◆ collectFiles()

void moveit_setup::controllers::ControlXacroConfig::collectFiles ( const std::filesystem::path &  ,
const GeneratedTime ,
std::vector< GeneratedFilePtr > &   
)
inlineoverridevirtual

Collect the files generated by this configuration and add them to the vector.

Parameters
[in]package_paththe path to the root of the config package
[in]last_gen_timeThe time (if any) when the config package was last generated @parma[out] files Where to put the new generated files

Reimplemented from moveit_setup::SetupConfig.

Definition at line 178 of file control_xacro_config.hpp.

◆ collectVariables()

void moveit_setup::controllers::ControlXacroConfig::collectVariables ( std::vector< TemplateVariable > &  )
overridevirtual

Collect key/value pairs for use in templates.

Parameters
[out]variablesWhere to put the new Variables

Reimplemented from moveit_setup::SetupConfig.

Definition at line 314 of file control_xacro_config.cpp.

Here is the call graph for this function:

◆ getArguments()

std::vector< std::pair< std::string, std::string > > moveit_setup::controllers::ControlXacroConfig::getArguments ( ) const
overridevirtual

Returns a list of name/value pairs for arguments that the modified urdf should have.

Result will be <xacro:arg name="pair.first" default="pair.second" />

Reimplemented from moveit_setup::IncludedXacroConfig.

Definition at line 91 of file control_xacro_config.cpp.

◆ getAvailableControlInterfaces()

const ControlInterfaces& moveit_setup::controllers::ControlXacroConfig::getAvailableControlInterfaces ( ) const
inline

Definition at line 88 of file control_xacro_config.hpp.

◆ getCommands()

std::vector< std::string > moveit_setup::controllers::ControlXacroConfig::getCommands ( ) const
overridevirtual

Return a list of additional commands that need to be inserted after the xacro is included.

e.g. If the included xacro includes a macro definition, the command to run the macro could be here.

Reimplemented from moveit_setup::IncludedXacroConfig.

Definition at line 98 of file control_xacro_config.cpp.

◆ getControlInterfaces() [1/2]

void moveit_setup::controllers::ControlXacroConfig::getControlInterfaces ( const std::string &  joint_name,
ControlInterfaces ci 
) const
protected

Definition at line 213 of file control_xacro_config.cpp.

Here is the call graph for this function:

◆ getControlInterfaces() [2/2]

const ControlInterfaces moveit_setup::controllers::ControlXacroConfig::getControlInterfaces ( const std::vector< std::string > &  joint_names) const

Get all the control interfaces for all of the specified joint names.

Definition at line 222 of file control_xacro_config.cpp.

◆ getDefaultControlInterfaces()

const ControlInterfaces& moveit_setup::controllers::ControlXacroConfig::getDefaultControlInterfaces ( ) const
inline

Definition at line 93 of file control_xacro_config.hpp.

◆ getFilepath()

std::string moveit_setup::controllers::ControlXacroConfig::getFilepath ( ) const
overridevirtual

The file path to use in the <xacro:include> tag.

If the file is in MoveIt config's config folder, just the file name is fine. Alternatively you can return a package string a la $(find SOME_PACKAGE_NAME)/relative/path/to/header.xacro

Implements moveit_setup::IncludedXacroConfig.

Definition at line 81 of file control_xacro_config.cpp.

◆ getJointsXML()

std::string moveit_setup::controllers::ControlXacroConfig::getJointsXML ( ) const

Return the additional joint xml needed for ros2_control tags.

Definition at line 232 of file control_xacro_config.cpp.

Here is the caller graph for this function:

◆ hasAllControlTagsInOriginal()

bool moveit_setup::controllers::ControlXacroConfig::hasAllControlTagsInOriginal ( ) const

Definition at line 160 of file control_xacro_config.cpp.

◆ hasChanges()

bool moveit_setup::controllers::ControlXacroConfig::hasChanges ( ) const
overridevirtual

Returns if the xacro and its properties have changed, resulting in the whole urdf needing regeneration.

Implements moveit_setup::IncludedXacroConfig.

Definition at line 86 of file control_xacro_config.cpp.

Here is the caller graph for this function:

◆ isConfigured()

bool moveit_setup::controllers::ControlXacroConfig::isConfigured ( ) const
overridevirtual

Return true if this part of the configuration is completely set up.

Reimplemented from moveit_setup::SetupConfig.

Definition at line 76 of file control_xacro_config.cpp.

◆ loadFromDescription()

void moveit_setup::controllers::ControlXacroConfig::loadFromDescription ( )

Load the original command interfaces from the original (unmodified) URDF.

Needs to be run whenever the URDF/SRDF may have changed

Definition at line 116 of file control_xacro_config.cpp.

Here is the call graph for this function:

◆ loadPrevious()

void moveit_setup::controllers::ControlXacroConfig::loadPrevious ( const std::filesystem::path &  ,
const YAML::Node &   
)
overridevirtual

Loads the configuration from an existing MoveIt configuration.

The data can be loaded directly from files in the configuration via the package path.

Certain other pieces of "meta" information may be stored in the .setup_assistant yaml file in the root of the configuration. If there is a node in that file that matches this config's name, it is passed in as an argument.

Parameters
package_pathThe path to the root folder of the configuration.

Reimplemented from moveit_setup::SetupConfig.

Definition at line 55 of file control_xacro_config.cpp.

Here is the call graph for this function:

◆ onInit()

void moveit_setup::controllers::ControlXacroConfig::onInit ( )
overridevirtual

Overridable initialization method.

Reimplemented from moveit_setup::SetupConfig.

Definition at line 46 of file control_xacro_config.cpp.

Here is the call graph for this function:

◆ saveToYaml()

YAML::Node moveit_setup::controllers::ControlXacroConfig::saveToYaml ( ) const
overridevirtual

Optionally save "meta" information for saving in the .setup_assistant yaml file.

Reimplemented from moveit_setup::SetupConfig.

Definition at line 68 of file control_xacro_config.cpp.

◆ setControlInterfaces()

void moveit_setup::controllers::ControlXacroConfig::setControlInterfaces ( const ControlInterfaces ci)

Use the specified controller interfaces for all the lacking joints.

Definition at line 165 of file control_xacro_config.cpp.

Here is the caller graph for this function:

Member Data Documentation

◆ available_ci_

ControlInterfaces moveit_setup::controllers::ControlXacroConfig::available_ci_
protected

Definition at line 193 of file control_xacro_config.hpp.

◆ changed_

bool moveit_setup::controllers::ControlXacroConfig::changed_
protected

Definition at line 196 of file control_xacro_config.hpp.

◆ default_ci_

ControlInterfaces moveit_setup::controllers::ControlXacroConfig::default_ci_
protected

Definition at line 193 of file control_xacro_config.hpp.

◆ initial_group_state_

srdf::Model::GroupState moveit_setup::controllers::ControlXacroConfig::initial_group_state_
protected

Definition at line 194 of file control_xacro_config.hpp.

◆ joint_names_

std::vector<std::string> moveit_setup::controllers::ControlXacroConfig::joint_names_
protected

Definition at line 190 of file control_xacro_config.hpp.

◆ new_joint_interfaces_

std::unordered_map<std::string, ControlInterfaces> moveit_setup::controllers::ControlXacroConfig::new_joint_interfaces_
protected

Definition at line 191 of file control_xacro_config.hpp.

◆ original_joint_interfaces_

std::unordered_map<std::string, ControlInterfaces> moveit_setup::controllers::ControlXacroConfig::original_joint_interfaces_
protected

A list of all joints used by the current SRDF groups.

Definition at line 191 of file control_xacro_config.hpp.


The documentation for this class was generated from the following files: