UAT 463 Smart Robotics and Automation

Worksheet 4 Assemble the software chain and interfaces of MM-1

Lab 12 hAssesses CLO2

Objective

Write the node graph, check timing, tf2, QoS and the life cycle, decode the encoder and calculate the bus load

Equipment and materials

  • Computer or board with ROS 2 installed
  • Camera and test wheel base, or a simulator
  • Encoder, gyro and driver of the test joint
  • CAN adapter and a bus analyser

Safety

  • Lift the wheel base so the wheels are off the ground, or use a guarded area, when testing cmd_vel_timeout and pulling the network cable
  • Switch off the driver power before connecting or removing the CAN adapter and encoder cable
  • Calculation and node-graph work is desk work

Steps

  1. Write the node graph of the cell, set the QoS of each topic and check compatibility with ros2 topic info --verbose
  2. Measure the 100 Hz timer when it shares a group with the detection callback, then separate the group and thread
  3. Stamp images at exposure and look up the transform at that time with tf2, compared with the latest pose
  4. Set cmd_vel_timeout to at least three values, count needless stops and measure the stopping distance when the network cable is pulled
  5. Test the driver node's life cycle: unplug the CAN adapter, activate, and look at the state it returns to
  6. Decode the encoder in hardware, check the one-turn count and the counter wrap, measure gyro bias for 5 s and report the heading error after 60 s
  7. Calculate the CAN load of all joints with the code of Example 7 and compare it with the load measured by the analyser

Record of results

Table 1 Timer timing and tf2 error
Setup or policyActual control rate (Hz)Longest gap (ms)Parcel position error (mm)Notes
Table 2 cmd_vel_timeout, needless stops and stopping distance
cmd_vel_timeout (ms)Needless stops per hourMeasured stopping distance (m)Calculated stopping distance (m)
Table 3 QoS, life cycle, encoder, gyro and bus
CheckResultExpectedUnit

Questions

  1. Why do two threads with every callback in the single default group behave like one thread? Explain with the numbers in Table 1.

  2. How many times smaller is the error when the transform is looked up at the stamp rather than using the latest pose, and how much does a higher tf rate help?

  3. From Table 2, which cmd_vel_timeout did the group choose? Explain the trade between needless stops and stopping distance, and what in module 5 this stopping distance must fit.

  4. If you subtract the 16-bit counter directly when it wraps, what speed does the PI receive? And without subtracting the gyro bias, how large is the heading error after 60 s?

  5. Why does the calculated CAN load differ from the load measured by the analyser, and can six joints at a 1 ms period run on 1 Mbit/s CAN?

Check before you hand in

What to hand in

  • Node graph and QoS check
  • Timer timing, tf2 error and needless-stop tables
  • Encoder counting results and the heading error
  • Calculated versus measured bus load table

CLO2 Develop and test a robot prototype that perceives, decides and controls its motion through ROS 2 and sensor and actuator interfaces. (CLOs are a web-team draft; the course owner sets the final ones.)

Instructors: answers and teaching notes for this worksheet are in the teaching pack