Gazebo | Ignition | Community
Ask Your Question

Revision history [back]

click to hide/show revision 1
initial version

To control the wheels you can use two methods :

joints[LEFT_FRONT_WHEELING]->SetParam("vel", 0, wheel_data_[LEFT_FRONT_WHEELING] / (wheel_diameter_ / 2.0));

You just have to get the right joint of your robot :

joints[LEFT_FRONT_WHEELING] = this->parent->GetJoint(left_front_wheeling_joint_name_);

and set the max force you want to apply on it :

joints[LEFT_FRONT_WHEELING]->SetParam("fmax", 0, torque);

Or

joint_controller_->SetVelocityTarget(joints[LEFT_FRONT_WHEELING]->GetScopedName(),wheel_data_[LEFT_FRONT_WHEELING] / (wheel_diameter_ / 2.0) );

You will have to get the joint controller :

joint_controller_ = this->parent->GetJointController();

And set your own PID :

gazebo::common::PID PID = gazebo::common::PID(500,0,10);
joint_controller_->SetVelocityPID(joints[LEFT_FRONT_WHEELING]->GetScopedName(), PID);