How to set joint state on franka ros dal example

asked 2021-04-22 07:18:33 -0500

dev4all12358 gravatar image

Hello, I modified the Franka Emika ROS example on Panda arm to be able to simulate move on it.

First I modify the robot_joint_state_publisher.cpp to send joint state every 100ms.

 ros::Publisher publisher = node_handle.advertise<sensor_msgs::JointState>("joint_states", 1);
  float value = 0.01;
  while(1){


      states.header.stamp = ros::Time::now();
      for (size_t i = 0; i < joint_names.size(); i++) {
        states.position[i] = value;
        states.velocity[i] = 0;
        states.effort[i] = 0;
      }
      publisher.publish(states);
      // std::cerr << "states "<< states <<std::endl;
      ros::spinOnce();
      rate.sleep();

      value +=0.1;
  }

In that case I launch the franka_visualization example and the robot in rviz is moving.

I want to do the same on the dual_arm_cartesian_impedance_example_controller. The two arms are well displayed on RViz but my previous probgram don't seems to send joint state on the good topic.

Here is the list of topic available after my launch:

/attached_collision_object
/camera/depth_registered/points
/clicked_point
/collision_object
/execute_trajectory/cancel
/execute_trajectory/feedback
/execute_trajectory/goal
/execute_trajectory/result
/execute_trajectory/status
/initialpose
/joint_states
/joint_states_desired
/move_base_simple/goal
/move_group/cancel
/move_group/display_contacts
/move_group/display_cost_sources
/move_group/display_grasp_markers
/move_group/display_planned_path
/move_group/fake_controller_joint_states
/move_group/feedback
/move_group/filtered_cloud
/move_group/goal
/move_group/monitored_planning_scene
/move_group/motion_plan_request
/move_group/ompl/parameter_descriptions
/move_group/ompl/parameter_updates
/move_group/plan_execution/parameter_descriptions
/move_group/plan_execution/parameter_updates
/move_group/planning_scene_monitor/parameter_descriptions
/move_group/planning_scene_monitor/parameter_updates
/move_group/result
/move_group/sense_for_plan/parameter_descriptions
/move_group/sense_for_plan/parameter_updates
/move_group/status
/move_group/trajectory_execution/parameter_descriptions
/move_group/trajectory_execution/parameter_updates
/panda_dual/target_pose_marker/feedback
/panda_dual/target_pose_marker/update
/pickup/cancel
/pickup/feedback
/pickup/goal
/pickup/result
/pickup/status
/place/cancel
/place/feedback
/place/goal
/place/result
/place/status
/planning_scene
/planning_scene_world
/robot_joint_state_publisher/joint_states
/rosout
/rosout_agg
/test/dual_arm_cartesian_impedance_example_controller/centering_frame
/test/joint_states
/test/panda_1/franka_gripper/joint_states
/test/panda_1_state_controller/franka_states
/test/panda_1_state_controller/joint_states
/test/panda_2/franka_gripper/joint_states
/test/panda_2_state_controller/franka_states
/test/panda_2_state_controller/joint_states
/tf
/tf_static
/trajectory_execution_event

What topic should I use and what joint message should I send?

edit retag flag offensive close merge delete