I've created a ros_control module that publishes velocity commands for two wheels modeled as joints, and launched a diff_drive controller. This setup works, but when I send a twist message asking the robot to go forward, one of the wheels starts rotating before the other, creating a small but noticeable change in robot's orientation. Is there a way to synchronize the command between the channels?
The relevant code that publishes the commands in my side is:
for (unsigned int i=0;i<num_joints_;i++) {
roboteq_msgs::Command c;
c.mode = 0;
c.setpoint = joint_velocity_command_[i] * ((i==0) ? -1 : 1); //left wheel control must be inverted
motor_controller_[i].publish(c);
}
I've created a ros_control module that publishes velocity commands for two wheels modeled as joints, and launched a diff_drive controller. This setup works, but when I send a twist message asking the robot to go forward, one of the wheels starts rotating before the other, creating a small but noticeable change in robot's orientation. Is there a way to synchronize the command between the channels? The relevant code that publishes the commands in my side is: