RobotDriver component
This is the RobotDriver component from the GenoM3 OSMOSIS show case. It controls a Robotnik robot.
The code does not really controls the robot as we do not have access to the source code of the low level driver. Instead we rely on the basic topics used (we publish those) and produced (we subscribe to those) by the robot ROS controller:
-
Odometry (topic
/odom
): the real odometry topic (linear and angular speed) of the robot which we publish in theor_pose_estimator
PoseOdometry (out) port. -
Joystick (topic
/joy
): the joystick values which we publish in the Joy (out) port. -
The Cmd (in) port contains the velocity (produced by SafetyPilot) to be written in the geometry::Twist
/summit_xl_control/cmd_vel
topic.
We rely on two tasks and services to do this:
-
RGWR (Read GenoM Write ROS) and ReadGenoMPortsWriteROSTopics (activity), read the The Cmd (in) port and publish the
/summit_xl_control/cmd_vel
topic. -
RRWG (Read ROS Write GenoM) and ReadROSTopicsWriteGenoMPorts (activity), subscribe to the
/odom
and/joy
topics and write them in the correspongin ports: PoseOdometry (out) and Joy (out).
Note that this GenoM3 component makes more sense when running under the PocoLibs middleware. Indeed, if one runs the ROS-Com middleware, you may as well access and publish the topics directly. No need to read/write ROS topics in ROS topics… |
Ports
PoseOdometry (out)
Data structure
|
The current odometry read from the /odom
ROS topic of the robot.
Joy (out)
Data structure
|
The current joystick value read from the /joy
ROS topic of the robot.
Cmd (in)
Data structure
|
The speed command we need to execute. We will read this speed Cmd port and publish
it in the /summit_xl_control/cmd_vel
ROS topic.
Services
SetOdomTopicName (attribute)
Inputs
|
Set the odom topic name.
SetCmdVelTopicName (attribute)
Inputs
|
Set the cmd_vel topic name.
Stop (function)
Context
|
Terminate the program stopping both activities.
ReadGenoMPortsWriteROSTopics (activity)
Throws
|
From GenoM ports to ROS topics.
ReadROSTopicsWriteGenoMPorts (activity)
Throws
|
Context
|
From ROS topics to GenoM ports.