We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
there is a wrong calculation of the command to the motors. what you have now:
void Driver::cmd_vel_callback(const geometry_msgs::Twist& msg){ std::stringstream cmd_sub; cmd_sub << "!G 1" << " " << msg.linear.x << "" << "!G 2" << " " << msg.angular.z << "";
ser.write(cmd_sub.str()); ROS_INFO_STREAM(cmd_sub.str());
} void Driver::roboteq_subscriber(){ ros::NodeHandle n; cmd_vel_sub = n.subscribe("/cmd_vel",10,&Driver::cmd_vel_callback,this);
}
void Driver::roboteq_subscriber(){ ros::NodeHandle n; cmd_vel_sub = n.subscribe("/cmd_vel",10,&Driver::cmd_vel_callback,this);
and what you need is void Driver::cmd_vel_callback(const geometry_msgs::Twist& msg){ std::stringstream cmd_sub; double cmd_left, cmd_right; int kW = 1; //TODO:gemotrical property of the robot(width,radius) cmd_left = msg.linear.x-msg.angular.zkW; cmd_right = msg.linear.x+msg.angular.zkW; cmd_sub << "!G 1" << " " << cmd_left << "" << "!G 2" << " " << cmd_right << "";
this is a more logical way to calculate the angular velocity to the wheels then before
The text was updated successfully, but these errors were encountered:
@noam7777 After reading:
http://wiki.ros.org/simple_drive#Twist_to_Tank_Calculation
I found that the code below did the trick for skid steer type vehicles.
void Driver::cmd_vel_callback(const geometry_msgs::Twist& msg) { std::stringstream cmd_sub; double cmd_left, cmd_right; cmd_left = msg.linear.x-msg.angular.z; cmd_right = msg.linear.x+msg.angular.z; cmd_sub << "!G 1" << " " << cmd_left << "_" << "!G 2" << " " << cmd_right << "_"; ser.write(cmd_sub.str()); ROS_INFO_STREAM(cmd_sub.str()); }
Sorry, something went wrong.
No branches or pull requests
there is a wrong calculation of the command to the motors.
what you have now:
void Driver::cmd_vel_callback(const geometry_msgs::Twist& msg){
std::stringstream cmd_sub;
cmd_sub << "!G 1" << " " << msg.linear.x << "" << "!G 2" << " " << msg.angular.z << "";
}
void Driver::roboteq_subscriber(){
ros::NodeHandle n;
cmd_vel_sub = n.subscribe("/cmd_vel",10,&Driver::cmd_vel_callback,this);
}
void Driver::roboteq_subscriber(){
ros::NodeHandle n;
cmd_vel_sub = n.subscribe("/cmd_vel",10,&Driver::cmd_vel_callback,this);
}
and what you need is
void Driver::cmd_vel_callback(const geometry_msgs::Twist& msg){
std::stringstream cmd_sub;
double cmd_left, cmd_right;
int kW = 1; //TODO:gemotrical property of the robot(width,radius)
cmd_left = msg.linear.x-msg.angular.zkW;
cmd_right = msg.linear.x+msg.angular.zkW;
cmd_sub << "!G 1" << " " << cmd_left << "" << "!G 2" << " " << cmd_right << "";
}
void Driver::roboteq_subscriber(){
ros::NodeHandle n;
cmd_vel_sub = n.subscribe("/cmd_vel",10,&Driver::cmd_vel_callback,this);
}
this is a more logical way to calculate the angular velocity to the wheels then before
The text was updated successfully, but these errors were encountered: