Skip to content

caster angle errors published by pr2_base_controller2 are wrong #379

@goretkin

Description

@goretkin

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions