Access `robot_description` from `ros2_control` hardware
Hello,
I am currently working on a ros2_control
hardware that can be dynamically set up and assembled using module as plugin components. Is there a way to get access to the robot_description
from inside the hardware interface in on_configure()
?
I would like to describe my hardware like this
<hardware>
<plugin>driver/Driver</plugin>
<module>
<plugin>plugin/Module1</plugin>
</module>
<module>
<plugin>plugin/Module2</plugin>
</module>
</hardware>
Is this possible ? If not should I rather pass the modules as parameters like this
<hardware>
<plugin>driver/Driver</plugin>
<param name="module_list">"[module1, module2]"</param>
</hardware>
Thanks!
per my understanding, the
controller_manager
is just reading therobot_description
from therobot_state_publisher
node that's expected to be running. I don't see any reason why you couldn't also get this parameter directly in the same fashionfor me it is getting the parameter passed from the launch file directly without the need of launching the
robot_state_publisher
, but you are right that it can be a solution. The point is that this data should be already somewhere inside so is it possible to get it directly without the need of listening to the topic?the
robot_description
is only used to initialize the resource_manager_which is stored withprivate
access, and I am not aware of any existing interfaces to access it directly through the "hardware_interface" classes. But if you don't need the rawrobot_description
urdf output, then perhaps you can look at the accessor methods provided byresource_manager
. There are public methods available to list actuators, sensors etc. But I don't think ros2_control, by default, stores any awareness of the geometry, etc