Project

General

Profile

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 the or_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:

Note 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
  • struct ::or_pose_estimator::state PoseOdometry

    • struct ::or::time::ts ts

      • unsigned long sec

      • unsigned long nsec

    • boolean intrinsic

    • optional< struct ::or::t3d::pos > pos

      • double x

      • double y

      • double z

      • double qw

      • double qx

      • double qy

      • double qz

    • optional< struct ::or::t3d::pos_cov > pos_cov

      • double cov[28]

    • optional< struct ::or::t3d::vel > vel

      • double vx

      • double vy

      • double vz

      • double wx

      • double wy

      • double wz

    • optional< struct ::or::t3d::vel_cov > vel_cov

      • double cov[21]

    • optional< struct ::or::t3d::acc > acc

      • double ax

      • double ay

      • double az

    • optional< struct ::or::t3d::acc_cov > acc_cov

      • double cov[6]

The current odometry read from the /odom ROS topic of the robot.


Joy (out)

Data structure
  • struct ::JoyStick::sensor_msgs_Joy Joy

    • struct ::JoyStick::std_msgs_header header

      • unsigned long seq

      • struct ::JoyStick::msgs_time stamp

        • unsigned long sec

        • unsigned long nsec

      • string frame_id

    • sequence< float > axes

    • sequence< long > buttons

The current joystick value read from the /joy ROS topic of the robot.


Cmd (in)

Data structure
  • struct ::geometry::geometry_msgs_Twist Cmd

    • struct ::geometry::geometry_msgs_Vector3 linear

      • double x

      • double y

      • double z

    • struct ::geometry::geometry_msgs_Vector3 angular

      • double x

      • double y

      • double z

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
  • string odom_topic_name (default "/odom")

Set the odom topic name.


SetJoyTopicName (attribute)

Inputs
  • string joy_topic_name (default "/joy")

Set the joy topic name.


SetCmdVelTopicName (attribute)

Inputs
  • string cmd_vel_topic_name (default "/summit_xl_control/cmd_vel")

Set the cmd_vel topic name.


SetVerbose (function)

Inputs
  • long verbose_level (default "0") Verbose level

Set the verbose level.


Terminate (function)

Terminate the program by telling also ros it is finished.


Stop (function)

Terminate the program stopping both activities.


Init (function)

Do the ros::init.


ReadGenoMPortsWriteROSTopics (activity)

Throws
  • exception ::RobotDriver::bad_speed_cmd_port

  • exception ::RobotDriver::bad_ROS_topic

Context

From GenoM ports to ROS topics.


ReadROSTopicsWriteGenoMPorts (activity)

Throws
  • exception ::RobotDriver::bad_pose_odometry_port

Context

From ROS topics to GenoM ports.


Tasks

RGWR

Context
  • Frequency 25.0 Hz

Throws
  • exception ::RobotDriver::bad_speed_cmd_port


RRWG

Context
  • Free running

Throws
  • exception ::RobotDriver::bad_pose_odometry_port