Ask Your Question

Revision history [back]

click to hide/show revision 1
initial version

disabling PID and setting target on launch

http://wiki.ros.org/pid

When I start/restart a PID node, the setpoint is always set to 0, but the actual current position may be something else. If I want to make sure that my robot doesn't move back to 0 every time I restart the PID node, how would I give it an initial value, read from a node publishing the robots actual position? (the position publisher is on an arduino)

In other words, what I want to do is set the setpoint = current_position whenever the PID node starts/restarts.

disabling PID and setting target on launch

http://wiki.ros.org/pid

When I start/restart a PID node, the setpoint is always set to 0, but the actual current position may be something else. If I want to make sure that my robot doesn't move back to 0 every time I restart the PID node, how would I give it an initial value, read from a node publishing the robots actual position? (the position publisher is on an arduino)

In other words, what I want to do is set the setpoint = current_position whenever the PID node starts/restarts.

These are the steps to reproduce the issue:

  1. Start the Arduino (publishes actual position)
  2. Move the robot manually to 5 meters (the arduino now publishes the current position as +5 meters)
  3. Start the PID; the PID is automatically set to "enabled" with a set position of "0"
  4. Robot moves to 0 without explicit instruction to do so

So I think the best solution would be to have an parameter to disable the PID on start. That way whatever logic enables it can make sure that the set-point is set correctly.