Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

caster angle errors published by pr2_base_controller2 are wrong #379

Open
goretkin opened this issue Mar 18, 2015 · 1 comment
Open

caster angle errors published by pr2_base_controller2 are wrong #379

goretkin opened this issue Mar 18, 2015 · 1 comment

Comments

@goretkin
Copy link

If you rostopic echo /base_controller/state after having moved the robot around in circles but keeping the same heading, the casters will have rotated around (they're continuous rotation joints), the first four numbers of joint_error: corresponding to the caster angles, will be multiples of pi, even though the true error is zero as calculated for the PID controller:

steer_angle_desired_m_pi = angles::normalize_angle(steer_angle_desired + M_PI);
error_steer = angles::shortest_angular_distance(
base_kinematics_.caster_[i].joint_->position_,
steer_angle_desired);
error_steer_m_pi = angles::shortest_angular_distance(
base_kinematics_.caster_[i].joint_->position_,
steer_angle_desired_m_pi);

The error calculation for publishing (here:

state_publisher_->msg_.joint_effort_error[i] = base_kinematics_.caster_[i].joint_->measured_effort_ - base_kinematics_.caster_[i].joint_->commanded_effort_;
) should match the error calculation above.

@trainman419
Copy link
Contributor

If you change this, be very careful in your testing. If the gains or the error term for any of the caster motors is wrong, the motors can fight each other and burn out.

I recommend lifting the robot slightly off the floor by putting it on wooden blocks while testing this.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants