ROS Resources: Documentation | Support | Discussion Forum | Index | Service Status | ros @ Robotics Stack Exchange |
1 | initial version |
if you could please assist by providing the steps for implementing the geometry_msgs/Twist which the base_controller (in image below) is getting, and converting it to messages I can map to commands for my stepper drives
what you write here is exactly what the diff_drive_controller
does: it takes in Twist
s and converts those rad/s for each wheel based on the configuration that you provide it.
The only thing you need to do is write a hardware_interface
that can convert those rad/s into something your actuators can work with. And "work with" means:
That is what a hardware_interface
does (here in the implementation that you link to).
They typically also read whatever sensor you then have on those actuators and convert whatever internal units those sensors use to SI units and offer them up to the "higher layers" of ros_control
(ie: the controllers) to publish them as ROS messages or to use them directly if configured for closed-loop control (reading happens here).
As to your example hardware_interface
: that one happens to be using ROS messages as its input and output. That is fine. It's not a requirement though. A lot of hardware_interface
s read or write directly from/to registers or shared memory and don't use ROS messages at all.
In the end it doesn't matter: as long as the hardware_interface
implements the required interface (ie: read(..)
, write(..)
and some other methods) ros_control
can work with it.
2 | No.2 Revision |
if you could please assist by providing the steps for implementing the geometry_msgs/Twist which the base_controller (in image below) is getting, and converting it to messages I can map to commands for my stepper drives
what you write here is exactly what the diff_drive_controller
does: it takes in Twist
s and converts those to rad/s for each wheel based on the configuration that you provide it.
The only thing you need to do is write a hardware_interface
that can convert those rad/s into something your actuators can work with. And "work with" means:
That is what a hardware_interface
does (here in the implementation that you link to).
They typically also read whatever sensor you then have on those actuators and convert whatever internal units those sensors use to SI units and offer them up to the "higher layers" of ros_control
(ie: the controllers) to publish them as ROS messages or to use them directly if configured for closed-loop control (reading happens here).
As to your example hardware_interface
: that one happens to be using ROS messages as its input and output. That is fine. It's not a requirement though. A lot of hardware_interface
s read or write directly from/to registers or shared memory and don't use ROS messages at all.
In the end it doesn't matter: as long as the hardware_interface
implements the required interface (ie: read(..)
, write(..)
and some other methods) ros_control
can work with it.