Subscriber receives 0 value
I am publishing the pose from a node and receiving it another node. For some reason the subscriber is always getting a 0 value. Below is the ROS_INFO output of both the published message and the subscribed message.
[ INFO] [1467443650.648643683]: 0.174000 -0.289000 -0.275000
[ INFO] [1467443634.965920060]: 0.000000 0.000000 0.000000
This is a code snippet of the callback function where I am ROS_INFOing the message.
void BaseModule::KinematicsPoseMsgCallback( manipulator_base_module_msgs::KinematicsPose msg)
{
if( enable == false )
return;
ROS_INFO("%f %f %f", msg.pose.position.x, msg.pose.position.y, msg.pose.position.z);
Robotis->kinematics_pose_msg = msg;
Does anyone know why this might be the case? Please tell me if you need any more information to solve this problem. Thanks.
Edit: These are the publisher messages:
ros::Publisher k_i = n.advertise<manipulator_base_module_msgs::KinematicsPose>("kinematics_input", 10);
manipulator_base_module_msgs::KinematicsPose kin;
kin.pose.position.x = 0.174;
kin.pose.position.y = -0.289;
kin.pose.position.z = -0.275;
k_i.publish(kin);
How do you publish the messages? What does rostopic echo show? [BTW: if( enable == false ) -> if (not enable)