Skip to content

head movement

Rodrigo Serra edited this page Nov 28, 2023 · 1 revision

Head Movement :

Description

The mbot driver can turn the head to a specific angle, however the semantic head controller can choose appropriate values for you, based on cardinal directions and a speed value.

The semantic head controller subscribes to a semantic topic (/semantic_head_controller_node/cmd) and publishes a low level msg directly to the mbot driver (/cmd_head)

To view the message options do:

rosmsg show monarch_msgs/HeadControlSemantic
  uint8 NORMAL=0
  uint8 SLOW=1
  uint8 FAST=2
  string cardinal_direction
  uint8 speed

Usage

To launch the node with appropriate remappings:

roslaunch mbot_semantic_head_controller semantic_head_controller_example.launch

To move the head, you can do:

rostopic pub /semantic_head_controller_node/cmd monarch_msgs/HeadControlSemantic "cardinal_direction: 'W'
speed: 0"

For speed, choose one of the predefined numbers (0,1,2) in the msg definition. For cardinal direction, you can choose any of (N, E, W, NW, NE) or equivalent such as (NORTH, EAST, ...).

Unsupported commands

If the direction or speed is unavailable, the controller node will output an error message, examples:

[ERROR] [/semantic_head_controller_node]: Unsupported speed 3

[ERROR] [/semantic_head_controller_node]: Unsupported cardinal direction SOUTH


Development tips

When publishing a msg of type monarch_msgs/HeadControlSemantic through code, you can use the definitions in the message to define the speed. Examples:

  • Python: monarch_msgs.msg.HeadControlSemantic.FAST

  • C++: monarch_msgs::HeadControlSemantic::FAST

Clone this wiki locally