Skip to content
Jacob Allen edited this page Mar 31, 2020 · 4 revisions

Motor Server

The motor node provides topics for the left and right motors which allow setting the speed and reading the current step count, and an estimate of position using the step counts.

Parameters

  • ~rate, float: the rate at which odometry and steps are published (default: 10 Hz).
  • tf_prefix, str: the transform prefix for reference frames.

Published Topics

  • motors/steps_left, UInt16: current left step counter value.
  • motors/steps_right, UInt16: current right step counter value.
  • motors/real_steps_left, Int64: current left step counter (including overflows).
  • motors/real_steps_right, Int64: current right step counter (including overflows).
  • motors/odometry, Odometry: odometry estimate from step counters.

Subscribed Topics

  • motors/speed_left, Float32: left motor speed between -1.0 and 1.0.
  • motors/speed_right, Float32: left motor speed between -1.0 and 1.0.

Dependencies

Python

  • SMBus

Base Controller

Base controller for navigation stacks to convert /cmd_vel messages to motor speeds.

Parameters

  • ~rate, float: the rate at which motor speeds are updated, only used if ~fixed_rate is true (default: 10 Hz).
  • ~fixed_rate, bool: whether a fixed rate for motor speed updates should be used (default: false).
  • ~angular_smoothing, float: speed smoothing on angular speed, see Motor Control section below (default: 0.65).
  • ~linear_smoothing, float: speed smoothing on linear speed, see Motor Control section below (default: 1.25).
  • ~motor_control_mode, str: can be set to simple or complex, see Motor Control section below (default: complex).

Published Topics

  • motors/speed_right, Float32: See motors above.
  • motors/speed_left, Float32: See motors above.

Subscribed Topics

  • /cmd_vel, Twist: commands with requested linear x and angular z. Should be remapped if using multiple Pi-pucks.

Motor Control

Simple

Simple control uses a direct correspondence from requested movement to motor speeds using wheel diameter and separation to estimate correct motor speeds.

Does not support smoothing.

Complex

Complex control uses the robots physical dimensions to more accurately set motor speeds to match twist parameters. Complex control should therefore be more accurate to the commands being received.

Complex mode also supports smoothing using the following formula: sign(velocity) * abs(velocity) ^ smoothing. Where velocity is the initial angular or linear velocity output of the complex controller and smoothing is the smoothing parameter for angular or linear velocity as specified in the node's parameters.