I want to move joint in rviz
Recently I use ROS for moving mobile manipulator, which has 2 wheels(2dof) 2arms(16dof) pan tilt camera(2dof) tilt laser(1dof)...
I'm newbie of ROS and have met a problem...
I use moveit! to plan arms motion and get joint value from joint_state_publisher to get joint value from rviz. after that I want to send joint value to rviz use same topic(joint_states)... Yes it works robot joint moves in rviz but very short time.... is there any solution for this?
here is my code and I use demo.launch file from moveit created project
Joint_Pub.publish(joint_value_for_moveit_update); // publish part in intialize function
.....
void QNode::Joint_cb(sensor_msgs::JointState msg) // Callback function
{
joint_state_moveit = msg;
for(int i=2;i<18;i++)
_joint_state_view[i-2] = msg.position[i];
}
......
joint_value_for_moveit_update.position.clear(); // publish part activated by pushbutton in QT
joint_value_for_moveit_update.name.clear();
for(int i=0;i<joint_state_moveit.position.size();++i)
{
joint_value_for_moveit_update.position.push_back(0.707);
joint_value_for_moveit_update.name.push_back(joint_state_moveit.name[i]);
}
please help me