I have a four wheeled differential driving machine. I am writing a plugin that requires turn rate. Is there a way to find the velocity of a specific wheel in a machine?
Here is my Turn Rate Method.
int32_t calcTurnRate()
{
//Define pointers to front left and front right wheels
gazebo::physics::LinkPtr RWheel = this->model->GetChildLink(
"base_link::Rwheel_chassis::front_right_wheel");
gazebo::physics::LinkPtr LWheel = this->model->GetChildLink(
"base_link::Lwheel_chassis::front_left_wheel");
//Components of Wheel Velocities
int32_t RVel = RWheel->GetRelativeLinearVel().x;
int32_t LVel = LWheel->GetRelativeLinearVel().x;
//return turn rate
return (RVel- LVel) * (WHEELBASE / 2);
}
↧