-
Notifications
You must be signed in to change notification settings - Fork 0
Robobo Topics
Before starting, a series of considerations must be taken into account for working with topics in Robobo:
- The Robobo has a sleep mode. After little time without utilize it, it goes to that mode for saving battery. In the sleep mode, the Robobo do not send information to the topics suscribed to it.
- Topics can be utilized as publishers (“pub”), listener (“echo”) and some acept both. To utilize the topics as publishers, it is necessary to know the ROS Hostname of the computer, as well as setting it in the environment. This is done by typing in a console:
ifconfig
Then set the ROS Hostname according to the obtained IP. For example:export ROS_HOSTNAME=192.168.0.12
This would be remenbered in some point along the documentation.
The different rostopics implemented in Robobo are:
- /robot/accel: Linear acceleration sensor.
- /robot/ambientlight: Ambient light sensor.
- /robot/battery/base: Battery level of the Robobo base.
- /robot/battery/phone: Battery level of the smarpthone.
- /robot/blob: Blob color detection. Red, blue, green and customized color.
- /robot/camera/camera_info: Meta information about the robot camera.
- /robot/camera/image/compressed: Stream of images from the robot camera compressed with compressed_image_transport.
- /robot/detected_object: Identification of an Aruco marker. /robot/emotion: Notifies changes in the emotion (face) of the robot.
- /robot/fling: Notifies a fling event in the touch screen (face) of the robot.
- /robot/irs: Notifies changes in the values of the IR (infrared) sensors located in the Robobo base.
- /robot/lane: Activate the lane detection module. Useful for autonomous driving.
- /robot/leds: Notifies changes in the color of a led of the Robobo base.
- /robot/module_control: Activate specific modules of Robobo.
- /robot/move_pan_tilt: Moves the Pan and/or Tilt mechanisms of the Robobo base.
- /robot/move_wheels: Move the wheels of Robobo.
- /robot/orientation: Gyroscope sensor. Quaternion values.
- /robot/orientation_euler: Gyroscope sensor. Euler angles.
- /robot/pan: Notifies changes in the position of the pan mechanism of the Robobo base.
- /robot/play_sound: The Robobo plays a predefined sound.
- /robot/qr/change: Notifies a change when detecting a new Qr.
- /robot/qr/status: Notifies information about the detected Qr.
- /robot/reset_wheels: Resets the encoders of the wheels to 0.
- /robot/set_blob: Activate or deactivate the blob detection.
- /robot/set_camera: Select the frontal camera of the back camera.
- /robot/set_emotion: Set a predefined emotion in Robobo.
- /robot/set_frequency: Changes the notification frequency of all the topics of the Robobo robot.
- /robot/set_led: Changes the color of one led of the Robobo base.
- /robot/tag: Notifies information about the ArUco marker detected.
- /robot/talk: Allows Robobo to speech.
- /robot/tap: Notifies a tap event in the touch screen (face) of the robot.
- /robot/tilt: Notifies changes in the position of the tilt mechanism of the Robobo base.
- /robot/unlock/move: Notifies when a topic or service related to move has ended.
- /robot/unlock/talk: Notifies when a topic or service related to move has ended.
- /robot/wheels: Notifies changes in the position of the wheels of the base.
All are available under the command:
rostopic list
A detailed explanation of the functionality of each topic is presented below:
Notifies changes in the robot (smartphone) accelerometer sensor. Only linear acceleration is provided.
Message:
A message of type 'geometry_msgs/Accel' where only the 'linear' field is populated with a 'std_msgs/Vector3' message that represents the current linear acceleration of the robot in the three axis.
Example
rostopic echo /robot/accel
Notifies the current level of ambient light in Lux units.
Message:
A message of type 'std_msgs/Int32' where the 'data' represents the level of ambient light in Lux units.
Example
rostopic echo /robot/ambientlight
Notifies the current battery level of the smartphone.
Message:
A message of type 'std_msgs/Int8' where the 'data' represents the battery level of the smartphone.
Example
rostopic echo /robot/battery/phone
Notifies the current battery level of the Robobo base.
Message:
A message of type 'std_msgs/Int8' where the 'data' represents the level of the Robobo base.
Example
Remember that It will only change if there is a change in the battery level of the base.
rostopic echo /robot/battery/base
Notifies changes in the color of the blob detected. To utilize this topic, the camera of the smartphone must be firstly calibrated. To that, go to initial ROS application page and select calibration. Follow the instructions to calibrate the red, blue, green and customized colors. Otherwise, the desired object may not be detected.
Message
A message of type 'robobo_msgs/Blob' .
Example
rostopic echo /robot/blob
Notifies information about the features of the camera.
Message
A sensor of type ‘sensor_msgs/CameraInfo‘
Example
rostopic echo /robot/camera/camera_info
Camera images are published in /robot/camera/image/compressed using the compressed_image_transport method. Users can employ these images to process or view them in applications such as rqt_image_view or rviz.
Message
A message of type ‘sensor_msgs/CompressedImage’
Example
rostopic echo /robot/camera/image/compressed
For this topic, the “vision_msgs” package is required. For that: 1. Download it from gitHub: https://github.com/ros-perception/vision_msgs.git 2. Copy the folder “aruco_msgs” into the Robobo workspace. 3. At the root directory of your workspace run 'catkin_make install'. 4. And finally run 'source devel/setup.bash' again:
Message
A message of type ‘vision_msgs/Detection2DArray’
Example
rostopic echo /robot/camera/camera_info
To utilize this topic, a service must be called:
rosservice call /robot/setModule "moduleName: data: 'face-detection'moduleState: data: true" error:data: 0
Available modules to call are ‘lane’, ‘line’, ‘line-stats’, ‘object-recognition’, ‘qr-tracking’, ‘tag’
Notifies a change in the emotion (face) displayed by the robot.
Message
A message of type 'std_msgs/String' where the 'data' represents the emotion as a string. Possible values are: happy, laughing, sad, angry, surprised, normal.
Example
rostopic echo /robot/emotion
To test it, make a call to the emotion service:
rosservice call /robot/setEmotion
or publishing a topic for changing the emotion. To do that, first, it is needed to set the ROS Hostname of the machine where the topic is executetd. Thus, in another terminal, run:
ifconfig
Then set the ROS Hostname according to the obtained IP. For example:
export ROS_HOSTNAME=192.168.0.12
This must be done when we would like to “publish” some information in a topic of Robobo (to give some order by means of the topics). Then, we can publish the desired information in the topic.
rostopic pub /robot/set_emotion robobo_msgs/SetEmotionCommand "emotion: data: 'write here the desired emotion'"
Notifies the detection of a drag gesture on the smartphone touchscreen.
Message
A message of type 'robobo_msgs/Fling' that has three fields:
- angle: A 'std_msgs/Int16' that represents the angle of the drag. Any integer between 0 and 360.
- time: A 'std_msgs/Int32' that represents the duration of the drag in milliseconds. Any positive integer.
- distance: A 'std_msgs/Int16' that represents the drag length measured in pixels. Any positive integer.
Example
rostopic echo /robot/fling
Notifies changes in the raw distance to obstacles detected by the Robobo base IR sensors. The base has eight IR sensors, five in the front and three in the back.
Message
A message of type 'robobo_msgs/IRs' where each field represents one particular LED of the base. Each field has the type 'sensor_msgs/Range' where only the next two fields are used:
- radiation_type: Fixed to 1 because all of them are infrared sensors.
- range: The raw distance value measured by the infrared sensors.
Each message notifies the current value of all the IR sensors in the base:
- Back-C: Sensor at the center in the back of the base.
- Back-L: Sensor at the left of the center in the back of the base.
- Back-R: Sensor at the right of the center in the back of the base.
- Front-C: Sensor at the center in the front of the base.
- Front-L: Sensor at the left in the front of the base.
- Front-LL: Sensor at the left of the left sensor in the front of the base.
- Front-R: Sensor at the right of the center in the front of the base.
- Front-RR: Sensor at right of the right sensor in the front of the base.
Example
rostopic echo /robot/irs
This topic uses the frames captured by the smartphone's camera to detect the lane limits present in the scene. It returns a object that contains 3 fields:
- The second order polynomial coefficients of the left lane.
- The second order polynomial coefficients of the right lane.
- The reverse transform matrix to the original frame.
Message
Message of type ‘robobo_msgs/Lane‘
Example
rostopic echo /robot/lane
Notifies changes in the color of the LEDs located in the Robobo base.
Message
A message of type 'robobo_msgs/Led' with the next fields:
- id: A string that identifies the led. Possible values: Front-C, Front-R, Front-L, Front-RR, Front-LL, Back-C, Back-R, Back-L.
- r: Float between 0.0 - 1.0 that represents the red value of the led.
- g: Float between 0.0 - 1.0 that represents the gree value of the led.
- b: Float between 0.0 - 1.0 that represents the blue value of the led.
Example
rostopic echo /robot/leds
Allows to load a specific module of Robobo, like the tag, object-detection and lane-detection modules.
Message
Message of type ‘robobo_msgs/ModuleControlCommand’
Example
rostopic pub /robot/module_control robobo_msgs/ModuleControlCommand "module_name: 'tag''on': true"
Argument for “module_name”: ‘lane’, ‘object-recognition’, ‘qr-tracking’ and ‘tag’.
Allows to move the pan, the tilt, or both with one call. Each of the movement commands is only executed if its unlockId is greater than 0. So, if you only want to move the pan, let the 'tiltUnlockid = 0', and if you only want to move the tilt, let 'panUnlockId = 0'.
Message
- panPos: Angle to position the pan at. Range: 11 ... 343.
- panSpeed: Movement speed for the pan mechanism. Range: 0 ... 100.
- panUnlockId: A unique 'blockid' for end-of-movement notification at /robot/unlock/move topic. Must be greater that 0 to move.
- tiltPos: Angle to position the tilt at. Range: 26 ... 109.
- tiltSpeed: Movement speed for the tilt mechanism. Range: 0 ... 100.
- tiltUnlockId: A unique 'blockid' for end-of-movement notification at /robot/unlock/move topic. Must be greater that 0 to move.
Example
Remember to set the ROS hostname first:
export ROS_HOSTNAME=192.168.0.12
And then:
rostopic pub /robot/move_pan_tilt robobo_msgs/MovePanTiltCommand "panPos:{data: 0} panSpeed: {data: 0} panUnlockId: {data: 0} tiltPos: {data: 0} tiltSpeed: {data: 0} tiltUnlockId: {data: 0}"
Allows changes in the Robobo base wheels speed and/or positions.
Message
A message of type 'robobo_msgs/Wheels' with the next fields:
- wheelPosR: Current right wheel encoder position. The value is increased linearly when the robot moves forwards, and decreases, even to negative numbers, when the robot moves backwards.
- wheelPosL: Current left wheel encoder position. The value is increased linearly when the robot moves forwards, and decreases, even to negative numbers, when the robot moves backwards.
- wheelSpeedR: Current right wheel speed in the range 0..100.
- wheelSpeedL: Current left wheel speed in the range 0..100.
Example
Remember to set the ROS hostname first:
export ROS_HOSTNAME=192.168.0.12
And then:
rostopic pub /robot/move_wheels robobo_msgs/MoveWheelsCommand "lspeed: data: 0 rspeed:data: 0 time: data: 0 unlockid: data: 0"
Notifies changes in the robot (smartphone) gyroscope sensor. It returns values in the form of a quaternion.
Message
A message of type 'geometry_msgs/Quaternion' that represents the orientation of the smartphone in free space.
Example
rostopic echo /robot/orientation
Notifies changes in the robot (smartphone) gyroscope sensor. It returns values in the form the yaw, pitch and roll values.
Message
A message of type 'robobo_msgs/OrientationEuler' that represents the orientation of the smartphone in free space.
Example
rostopic echo /robot/orientation_euler
Notifies changes in the Robobo base smartphone horizontal axis.
Message
A message of type 'std_msgs/Int16' where the 'data' represents the angle of the pan.
Example
rostopic echo /robot/pan
Allows changes in the sound emited by Robobo.
Message
A message of type ‘robobo_msgs/PlaySoundCommand’.
Example
rostopic pub /robot/play_sound robobo_msgs/PlaySoundCommand "sound: data: '(write here whatever sound from the list of below)'"
moan, purr, angry, approve, disapprove, discomfort, doubtful, laugh, likes, mumble, ouch, thinking.
Notifies information about a change in the Qr detected.
Message
Message of type ‘robobo_msgs/QrCodeChange‘
Example
rostopic echo /robot/qr/change
Notifies information about the Qr code detected.
Message
Message of type ‘robobo_msgs/QrCode’
Example
rostopic echo /robot/qr/status
Allows to reset the wheel encoder positions to 0. After calling this topic both encoders (topic /robot/wheels) will start again in position 0.
Message
A message of type 'robobo_msgs/ResetWheels'.
Example
Remember to set the ROS hostname first:
export ROS_HOSTNAME=192.168.0.12
And then:
rostopic pub /robot/reset_wheels robobo_msgs/ResetWheelsCommand "{}"
Allows to activate or deactivate the identification of the blob module. It allows to detect the red, green, blue and a custom color. Only the green color detection is activated by default.
Message
A message of type 'robobo_msgs/SetBlobCommand'.
Example
rostopic pub /robot/set_blob robobo_msgs/SetBlobCommand "red: true green: true blue: true custom: false"
Allows to change the camera of Robobo. Setting its value to 0, utilizes the front camera. Setting its value to 1, utilizes the back camera.
Message
A message of type ‘robobo_msgs/SetCameraCommand’
Example
rostopic pub /robot/set_camera robobo_msgs/SetCameraCommand "camera: data: 0"
Allows to change te emotion (face) of the robot.
Message
A message of type ‘robobo_msgs/SetEmotionCommand’
Example
rostopic pub /robot/set_emotion robobo_msgs/SetEmotionCommand "emotion: data: 'sad'"
Allows to change the notification frequency of all the sensors (topics) of the Robobo robot.
Message
A message of type ‘robobo_msgs/SetSensorFrequencyCommand’
Example
rostopic pub /robot/set_frequency robobo_msgs/SetSensorFrequencyCommand frequency: data: 0"
Allows to change the color of one LED of the base.
Message
Message of type ‘robobo_msgs/SetLed’
Example
rostopic pub /robot/set_led robobo_msgs/SetLedCommand "id: data: '(id)' color: data: '(color)'"
- id: String representing the 'id' of the led to change color. Possible values are: Front-C, Front-R, Front-RR, Front-L, Front-LL, Front-C, Back-R, Back-L, all.
- color: String representing the color color. Posible values are: white, red, blue, cyan, magenta, yellow, green, orange, off.
Identifies the corresponding ArUco tag. The ROS ArUco library is needed. For that:
- Download it from gitHub: https://github.com/pal-robotics/aruco_ros.git
- Copy the folder “aruco_msgs” into the Robobo workspace.
- At the root directory of your workspace run 'catkin_make install'.
- And finally run 'source devel/setup.bash' again.
Message
Message of type ‘aruco_ros/MarkerArray.msg’ where it returns a matix with the values of the tag.
Example
To utilize this ArUco detection library, first, activate the module of tag recognition by:
rosservice call /robot/setModule "moduleName: data: 'tag' moduleState: data: true"
or
rostopic pub /robot/module_control robobo_msgs/ModuleControlCommand "module_name: 'tag''on': true"
To suscribe to this topic, in other terminal run:
rostopic echo /robot/tag
It allows both to send text to Robobo and to suscribe to the topic for recognize the text sent.
Message
Message of type ‘robobo_msgs/TalkCommand’
Example
This topic can be utilized both as a “listener”
rostopic echo /robot/talk
or as a “publisher”
rostopic pub /robot/talk robobo_msgs/TalkCommand "text: data: '(write here the text)'"
Notifies a tap event in the touch screen (face) of the robot
Message
Message of type ‘robobo_msgs/Tap’
Example
rostopic info /robot/tap
Notifies changes in the Robobo base smartphone vertical axis.
Message
A message of the 'std_msgs/Int16' where the 'data' represents the angle of the tilt.
Example
rostopic echo /robot/tilt
Notifies when a service call o a published topic related to a movement has ended.
Message
A message of type ‘std_msgs/Int16’
Example
rostopic echo /robot/unlock/move
Notifies when a service call o a published topic related to talk has ended.
Message
A message of type ‘std_msgs/Int16’
Example
rostopic echo /robot/unlock/talk
Notifies a change in the position and velocity of Robobo.
Message
A message of type ‘robobo_msgs/Wheels’
Example
rostopic echo /robot/wheels
Empresa subvencionada por el CDTI (Presupuestos Generales del Estado a cargo de la aplicación 27.12.467C.74908) Concretamente, mediante el programa de Ayudas destinadas a nuevos proyectos empresariales de empresas innovadoras (Programa NEOTEC), al amparo de la Orden ECC/1333/2015, de 2 de julio.