Robobo Services - mintforpeople/robobo-programming GitHub Wiki
Robobo provides a set of ROS services in order to command the robot.
Nine command/actuation services are available:
- /robot/moveWheels: Moves the wheels of the Robobo base.
- /robot/resetWheels: Resets the encoders of the wheels to 0.
- /robot/movePanTilt: Moves the Pan and/or Tilt mechanisms of the Robobo base.
- /robot/talk: Says a text using the Text-to-Speech engine of the robot.
- /robot/playSound: Plays a sound from a predefined set of sounds.
- /robot/setCamera: Selects the camera, front or back.
- /robot/setEmotion: Changes the emotion (face) of the robot.
- /robot/setLed: Changes the color of one led of the Robobo base.
- /robot/setSensorFrequency: Changes the notification frequency of all the sensors (topics) of the Robobo robot.
The complete list of services can be obtained with the "rosservice list" command, which is also a powerful tool to explore and try the different services.
It is important to note that, in general, any new call to one particular service will immediately cancel a previous unfished order. So, for example, if we call '/robot/moveWheels' when a previous movement command is not finished, Robobo will start executing the new command, thus changing the movement without stopping.
Service of type 'robobo_msgs/MoveWheels' that commands the robot to move the wheels at a specified 'speed' during some 'time'.
When the requested movement command finishes moving, a notification is published in the topic '/robot/unlock/move', so that clients can know when a movement has finished. In order to use this functionality, clients must provide a unique 'blockid' for each MoveWheels request, and monitor the '/robot/unlock/move' topic until an unlock message is published with the specified 'blockid'.
Arguments
- lspeed: Speed of the left wheel in the range 0..100.
- rspeed: Speed of the right wheel in the range 0..100.
- time: Duration of the movement in milliseconds.
- blockid: A unique 'blockid' for end-of-movement notification at /robot/unlock/move topic.
Example:
rosservice call /robot/movePanTilt "panPos: {data: 50} panSpeed: {data: 10} panUnlockId: {data: 1} tiltPos: {data: 90} tiltSpeed: {data: 20} tiltUnlockId: {data: 2}
Service of type 'robobo_msgs/ResetWheels' to reset the wheel encoder positions to 0. After calling this service both encoders (topic /robot/wheels) will start again in position 0.
Arguments
No arguments.
Example:
rosservice call /robot/resetWheels
Service of type 'robobo_msgs/MovePanTilt' that commands the robot to move the smartphone holder in the vertical (tilt) and horizontal (pan) axis.
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'.
Arguments
- panPos: Angle to position the pan at. Range: 10 ... 345.
- 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: 5 ... 110.
- 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:
rosservice call /robot/moveWheels "lspeed: data: 50 rspeed: data: 20 time: data: 1000 unlockid: data: 1"
Service of type 'robobo_msgs/SetModule' that commands the robot to load a specific module of Robobo, like the tag, object-detection and lane-detection modules.
Arguments
- Module name: String representing the possible module: ‘tag’, ‘object-detection’, ‘lane-detection’.
- State: If we want the module activated or not: Bool(1) on, Bool(0) off.
Example:
rosservice call /robot/setModule "moduleName: data: 'tag' moduleState: data: true"
Service of type 'robobo_msgs/Talk' that commands the robot to say a text using Text-to-Speech (TTS).
When the robot finishes 'talking' a message is published in the '/robot/unlock/talk' topic to notify interested subscribers. This can be used to, for example, enqueu one talk command after another.
Arguments
- text: Text to be spoken.
Example:
rosservice call /robot/talk "text: data: 'jajajajajaja'"
Service of type 'robobo_msgs/PlaySound' that commands the robot to play an 'emotion sound' from a set of predefined sounds.
Arguments
- sound: Sound to play. Possible values are: moan, purr, angry, approve, disapprove, discomfort, doubtful, laugh, likes, mumble, ouch, thinking, various.
Example:
rosservice call /robot/playSound "sound: data: 'ouch'"
Service of type 'robobo_msgs/SetCamera' that commands the robot to change the active camera streamed to '/robot/camera/image/compressed' topic. It is possible to change the camera 'on the fly'.
Arguments
- camera: '1' for the front camera or '2' to select the back camera.
Example:
rosservice call /robot/setCamera "camera: data: 1"
Service of type 'robobo_msgs/SetEmotion' that commands the robot to change the face shown in the screen.
Arguments
- emotion: String representing the new emotion. Possible values are: happy, laughing, sad, angry, surprised, normal.
Example:
rosservice call /robot/setEmotion "emotion: data: 'angry'"
Service of type 'robobo_msgs/SetLed' that commands the robot to change the color of one LED of the base.
Arguments
- 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.
Example:
rosservice call /robot/setLed "id: data: 'Front-R' color: data: 'green'"
Service of type 'robobo_msgs/SetSensorFrequency' that commands the robot to change the frequency of notification of all the sensors of the robot.
Sensor notifications are only sent when there are changes, this service modifies the thresholds used to filter notifications in order to reduce network bandwidth. A higher notification frequency reduces the filter thresholds, and completely eliminates them at MAX value. Furthermore, in some sensors, high frequencies also modify the maximum number of messages per second of a particular sensor. Again, MAX runs the sensors at full speed.
Arguments
- frequency: String representing the frequency, one of: 'LOW', 'NORMAL', 'HIGH' or 'MAX' (MAX is the default at startup).
Example:
rosservice call /robot/setSensorFrequency "frequency: data: 20"
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.