Hi Andy, I am using your spaceto twist node to subscribe Twist message and convert it into Timestamped message. Also, In order not to make the robot freeze, I want to make sure all the message that I assigned to Timestamped message is smaller than 0.05 and please take a look at the following snippet of code for this purpose. However, when I print the message with ROS_ERROR() , some of the messages are still larger than 0.05(It make the robot freeze). Could you please tell me why? Thanks a lot.
void joyCallback(const geometry_msgs::Twist::ConstPtr& msg)
{
// Cartesian jogging with the axes
geometry_msgs::TwistStamped twist;
twist.header.stamp = ros::Time::now();
if (msg->linear.x < 0.05 ){
twist.twist.linear.x = msg->linear.x;}
if (msg->linear.x >= 0.05 ){
twist.twist.linear.x = 0.05;}
if (msg->linear.y < 0.05 ){
twist.twist.linear.y = msg->linear.y;}
if (msg->linear.y >= 0.05 ){
twist.twist.linear.y = 0.05;}
if (msg->linear.z < 0.05 ){
twist.twist.linear.z = msg->linear.z;}
if (msg->linear.z >= 0.05 ){
twist.twist.linear.z = 0.05;}
ROS_ERROR("Hello %s", "World");
ROS_ERROR("Hello %f", twist.twist.linear.x);
ROS_ERROR("Hello %f", twist.twist.linear.y);
ROS_ERROR("Hello %f", twist.twist.linear.z);
twist.twist.angular.x = 0;
twist.twist.angular.y = 0;
twist.twist.angular.z = 0;
// Joint jogging with the buttons
jog_msgs::JogJoint joint_deltas;
// This example is for a Motoman SIA5. joint_s is the base joint.
joint_deltas.joint_names.push_back("joint_s");
// Button 0: positive on the wrist joint
// Button 1: negative on the wrist joint
//joint_deltas.deltas.push_back(msg->buttons[0] - msg->buttons[1]);
joint_deltas.header.stamp = ros::Time::now();
twist_pub_.publish(twist);
joint_delta_pub_.publish(joint_deltas);
}
Hi Andy, I am using your spaceto twist node to subscribe Twist message and convert it into Timestamped message. Also, In order not to make the robot freeze, I want to make sure all the message that I assigned to Timestamped message is smaller than 0.05 and please take a look at the following snippet of code for this purpose. However, when I print the message with ROS_ERROR() , some of the messages are still larger than 0.05(It make the robot freeze). Could you please tell me why? Thanks a lot.