Versions Compared

Key

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

There are two three ways to control CPM vehicles, direct commands and trajectory commands. They take precedence in the following order:

  1. Direct Commands
  2. Path Tracking Commands
  3. Trajectory Commands

That means if a vehicle receives both Direct Commands and Trajectory Commands, it will perform the Direct Commands.

Direct Command

See https://github.com/embedded-software-laboratory/cpm_lab/blob/master/cpm_lib/dds_idl/VehicleCommandDirect.idl

...


motor_throttlesteering_servo
-1.0Maximum reverse accelerationFull right
0.0Brake, stopSteering roughly centered, but may have an offset
+1.0Maximum forward accelerationFull left

Path Tracking Command

The vehicles are controlled in path tracking mode with PathTracking-Messages.

The inputs in Path Tracking Mode are a path consisting of poses and distances. The distance describes the distance along the path from the first path point to the current path point. Between path points, an interpolation with cubic splines is done on the basis of the poses and the distances. If you understood the Trajectory Command structure, a path is basically a trajectory with the speed of 1.

Trajectory Command

See https://github.com/embedded-software-laboratory/cpm_lab/blob/master/cpm_lib/dds_idl/VehicleCommandTrajectory.idl

...

The points defining the spline must be given as a set of five numbers [ti, px(ti), py(ti), vx(ti), vy(ti)], where ti is the absolute time in nanoseconds of the trajectory point, [px, py] is the position vector (meters) and [vx, vy] is the velocity vector (m/s). The driving surface bounds are 0.0m < px < 4.5m and 0.0m < py < 4.0m.

The time between trajectory points t(i+1) t(i) is not fixed, but should be between 100 ms and 400 ms. Due to network latency and the controller structure, the trajectory points need to be created and sent ahead of time. The exact required lead time is TBD, but 1000 ms should be enough.

...