Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

  1. Since we want to use the head to track an objecta face, we need to set the stiffness to 1 to enable the motor motors to control the head joint

...

Code Block
target_name = "RedBall"
  1. Set a robot position relative to target. This is only needed in Move mode. The parameters represent [coordX, coordY, coordWz, thresholdX, thresholdY, thresholdWz]. In this case, it sets the target ball to be 30 cm away along the x-axis with a 10 cm threshold. The XYZ frame reference for the robot can be found here position-identification

Code Block
move_rel_position = [-0.3, 0.0, 0.0, 0.1, 0.1, 0.1]
  1. Track a red ball

Code Block
nao.tracker.request(
    StartTrackRequest(
        target_name=target_name,
        size=0.06,
        mode="Move",
        effector="Arms",
        move_rel_position=move_rel_position,
    )
)

4. Stop all tracking. This will put the robot into rest mode, unlocking all joints and setting stiffness to 0

Code Block
nao.tracker.request(StopAllTrackRequest())

A complete script for this tutorial can be found here: demo_nao_motiontracker.py