UAT 463 Smart Robotics and Automation
Worksheet 4 Assemble the software chain and interfaces of MM-1
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
- Write the node graph of the cell, set the QoS of each topic and check compatibility with ros2 topic info --verbose
- Measure the 100 Hz timer when it shares a group with the detection callback, then separate the group and thread
- Stamp images at exposure and look up the transform at that time with tf2, compared with the latest pose
- Set cmd_vel_timeout to at least three values, count needless stops and measure the stopping distance when the network cable is pulled
- Test the driver node's life cycle: unplug the CAN adapter, activate, and look at the state it returns to
- 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
- 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
| Setup or policy | Actual control rate (Hz) | Longest gap (ms) | Parcel position error (mm) | Notes |
|---|---|---|---|---|
| cmd_vel_timeout (ms) | Needless stops per hour | Measured stopping distance (m) | Calculated stopping distance (m) |
|---|---|---|---|
| Check | Result | Expected | Unit |
|---|---|---|---|
Questions
Why do two threads with every callback in the single default group behave like one thread? Explain with the numbers in Table 1.
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?
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.
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?
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