jmiseikis / ur5_inf3480

Demo code for controlling UR5 using ROS and MoveIt!
28 stars 8 forks source link

Errors while moving robot #6

Closed hychiang-git closed 5 years ago

hychiang-git commented 5 years ago

Hi All,

I modify inf3480_move_robot.cpp and ran roslaunch ur5_inf3480 ur5_launch_inf3480.launch, but I got some warnings and errors as follow:

... logging to /home/hychiang/.ros/log/087c5adc-3718-11e9-a629-ac220b8958ba/roslaunch-hychiang-lab-1$
116.log
Checking log directory for disk usage. This may take awhile.
Press Ctrl-C to interrupt
Done checking log file disk usage. Usage is <1GB.

started roslaunch server http://hychiang-lab:36553/

SUMMARY
========

PARAMETERS
 * /joint_state_publisher/use_gui: True
 * /move_group/allow_trajectory_execution: True
 * /move_group/capabilities: move_group/MoveGr...
 * /move_group/controller_list: [{'joints': ['sho...
 * /move_group/endeffector/planner_configs: ['SBLkConfigDefau...
 * /move_group/jiggle_fraction: 0.05
 * /move_group/manipulator/longest_valid_segment_fraction: 0.01
 * /move_group/manipulator/planner_configs: ['SBLkConfigDefau...
 * /move_group/max_range: 5.0
 * /move_group/max_safe_path_cost: 1
 * /move_group/moveit_controller_manager: moveit_fake_contr...
 * /move_group/moveit_manage_controllers: True
 * /move_group/octomap_resolution: 0.025
 * /move_group/planner_configs/BKPIECEkConfigDefault/border_fraction: 0.9
 * /move_group/planner_configs/BKPIECEkConfigDefault/failed_expansion_score_factor: 0.5
 * /move_group/planner_configs/BKPIECEkConfigDefault/min_valid_path_fraction: 0.5
 * /move_group/planner_configs/BKPIECEkConfigDefault/range: 0.0
 * /move_group/planner_configs/BKPIECEkConfigDefault/type: geometric::BKPIECE
 * /move_group/planner_configs/ESTkConfigDefault/goal_bias: 0.05
 * /move_group/planner_configs/ESTkConfigDefault/range: 0.0
 * /move_group/planner_configs/ESTkConfigDefault/type: geometric::EST
 * /move_group/planner_configs/KPIECEkConfigDefault/border_fraction: 0.9
 * /move_group/planner_configs/KPIECEkConfigDefault/failed_expansion_score_factor: 0.5
 * /move_group/planner_configs/KPIECEkConfigDefault/goal_bias: 0.05
 * /move_group/planner_configs/KPIECEkConfigDefault/min_valid_path_fraction: 0.5
 * /move_group/planner_configs/KPIECEkConfigDefault/range: 0.0
 * /move_group/planner_configs/KPIECEkConfigDefault/type: geometric::KPIECE
 * /move_group/planner_configs/LBKPIECEkConfigDefault/border_fraction: 0.9
 * /move_group/planner_configs/LBKPIECEkConfigDefault/min_valid_path_fraction: 0.5
 * /move_group/planner_configs/LBKPIECEkConfigDefault/range: 0.0
 * /move_group/planner_configs/LBKPIECEkConfigDefault/type: geometric::LBKPIECE
 * /move_group/planner_configs/PRMkConfigDefault/max_nearest_neighbors: 10
 * /move_group/planner_configs/PRMkConfigDefault/type: geometric::PRM
 * /move_group/planner_configs/PRMstarkConfigDefault/type: geometric::PRMstar
 * /move_group/planner_configs/RRTConnectkConfigDefault/range: 0.0
 * /move_group/planner_configs/RRTConnectkConfigDefault/type: geometric::RRTCon...
 * /move_group/planner_configs/RRTkConfigDefault/goal_bias: 0.05
 * /move_group/planner_configs/RRTkConfigDefault/range: 0.0
 * /move_group/planner_configs/RRTkConfigDefault/type: geometric::RRT
 * /move_group/planner_configs/RRTstarkConfigDefault/delay_collision_checking: 1
 * /move_group/planner_configs/RRTstarkConfigDefault/goal_bias: 0.05
 * /move_group/planner_configs/RRTstarkConfigDefault/range: 0.0
 * /move_group/planner_configs/RRTstarkConfigDefault/type: geometric::RRTstar
 * /move_group/planner_configs/SBLkConfigDefault/range: 0.0
 * /move_group/planner_configs/SBLkConfigDefault/type: geometric::SBL
* /move_group/planner_configs/TRRTkConfigDefault/frountierNodeRatio: 0.1                   [185/897]
 * /move_group/planner_configs/TRRTkConfigDefault/frountier_threshold: 0.0
 * /move_group/planner_configs/TRRTkConfigDefault/goal_bias: 0.05
 * /move_group/planner_configs/TRRTkConfigDefault/init_temperature: 10e-6
 * /move_group/planner_configs/TRRTkConfigDefault/k_constant: 0.0
 * /move_group/planner_configs/TRRTkConfigDefault/max_states_failed: 10
 * /move_group/planner_configs/TRRTkConfigDefault/min_temperature: 10e-10
 * /move_group/planner_configs/TRRTkConfigDefault/range: 0.0
 * /move_group/planner_configs/TRRTkConfigDefault/temp_change_factor: 2.0
 * /move_group/planner_configs/TRRTkConfigDefault/type: geometric::TRRT
 * /move_group/planning_plugin: ompl_interface/OM...
 * /move_group/planning_scene_monitor/publish_geometry_updates: True
 * /move_group/planning_scene_monitor/publish_planning_scene: True
 * /move_group/planning_scene_monitor/publish_state_updates: True
 * /move_group/planning_scene_monitor/publish_transforms_updates: True
 * /move_group/request_adapters: default_planner_r...
 * /move_group/start_state_max_bounds_error: 0.1
 * /move_group/trajectory_execution/allowed_execution_duration_scaling: 1.2
 * /move_group/trajectory_execution/allowed_goal_duration_margin: 0.5
 * /robot_description: <?xml version="1....
 * /robot_description_kinematics/manipulator/kinematics_solver: kdl_kinematics_pl...
 * /robot_description_kinematics/manipulator/kinematics_solver_attempts: 3
 * /robot_description_kinematics/manipulator/kinematics_solver_search_resolution: 0.005
 * /robot_description_kinematics/manipulator/kinematics_solver_timeout: 0.005
 * /robot_description_planning/joint_limits/elbow_joint/has_acceleration_limits: True
 * /robot_description_planning/joint_limits/elbow_joint/has_velocity_limits: True
 * /robot_description_planning/joint_limits/elbow_joint/max_acceleration: 3.15
 * /robot_description_planning/joint_limits/elbow_joint/max_velocity: 3.15
 * /robot_description_planning/joint_limits/shoulder_lift_joint/has_acceleration_limits: True
 * /robot_description_planning/joint_limits/shoulder_lift_joint/has_velocity_limits: True
 * /robot_description_planning/joint_limits/shoulder_lift_joint/max_acceleration: 3.15
 * /robot_description_planning/joint_limits/shoulder_lift_joint/max_velocity: 3.15
 * /robot_description_planning/joint_limits/shoulder_pan_joint/has_acceleration_limits: True
 * /robot_description_planning/joint_limits/shoulder_pan_joint/has_velocity_limits: True
 * /robot_description_planning/joint_limits/shoulder_pan_joint/max_acceleration: 3.15
 * /robot_description_planning/joint_limits/shoulder_pan_joint/max_velocity: 3.15
 * /robot_description_planning/joint_limits/wrist_1_joint/has_acceleration_limits: True
 * /robot_description_planning/joint_limits/wrist_1_joint/has_velocity_limits: True
 * /robot_description_planning/joint_limits/wrist_1_joint/max_acceleration: 3.2
 * /robot_description_planning/joint_limits/wrist_1_joint/max_velocity: 3.2
 * /robot_description_planning/joint_limits/wrist_2_joint/has_acceleration_limits: True
 * /robot_description_planning/joint_limits/wrist_2_joint/has_velocity_limits: True
 * /robot_description_planning/joint_limits/wrist_2_joint/max_acceleration: 3.2
 * /robot_description_planning/joint_limits/wrist_2_joint/max_velocity: 3.2
 * /robot_description_planning/joint_limits/wrist_3_joint/has_acceleration_limits: True
 * /robot_description_planning/joint_limits/wrist_3_joint/has_velocity_limits: True
 * /robot_description_planning/joint_limits/wrist_3_joint/max_acceleration: 3.2
 * /robot_description_planning/joint_limits/wrist_3_joint/max_velocity: 3.2
 * /robot_description_semantic: <?xml version="1....
 * /rosdistro: kinetic
 * /rosversion: 1.12.14
 * /rviz_hychiang_lab_19116_8629599548254108342/manipulator/kinematics_solver: kdl_kinematics_pl...
 * /rviz_hychiang_lab_19116_8629599548254108342/manipulator/kinematics_solver_attempts: 3
 * /rviz_hychiang_lab_19116_8629599548254108342/manipulator/kinematics_solver_search_resolution: 0.00
5
 * /rviz_hychiang_lab_19116_8629599548254108342/manipulator/kinematics_solver_timeout: 0.005
 * /source_list: ['/move_group/fak...

NODES                                                                                       [127/897]
  /
    inf3480_move_robot (ur5_inf3480/inf3480_move_robot)
    joint_state_publisher (joint_state_publisher/joint_state_publisher)
    move_group (moveit_ros_move_group/move_group)
    robot_state_publisher (robot_state_publisher/robot_state_publisher)
    rviz_hychiang_lab_19116_8629599548254108342 (rviz/rviz)

ROS_MASTER_URI=http://localhost:11311

process[joint_state_publisher-1]: started with pid [19136]
process[robot_state_publisher-2]: started with pid [19137]
process[move_group-3]: started with pid [19138]
process[rviz_hychiang_lab_19116_8629599548254108342-4]: started with pid [19143]
[ WARN] [1550906920.754994803]: Shutdown request received.
[ WARN] [1550906920.755079966]: Reason given for shutdown: [new node registered with same name]
process[inf3480_move_robot-5]: started with pid [19152]
[ WARN] [1550906920.809543136]: Shutdown request received.
[ WARN] [1550906920.809740503]: Reason given for shutdown: [new node registered with same name]
[ INFO] [1550906920.833096262]: Loading robot model 'ur5'...
[ WARN] [1550906920.833190148]: Skipping virtual joint 'fixed_base' because its child frame 'base_lin
k' does not match the URDF frame 'world'
[ INFO] [1550906920.833220618]: No root/virtual joint specified in SRDF. Assuming fixed joint
[ WARN] [1550906920.868164828]: Shutdown request received.
[ WARN] [1550906920.868204379]: Reason given for shutdown: [new node registered with same name]
[ INFO] [1550906920.880975741]: rviz version 1.12.16
[ INFO] [1550906920.881018046]: compiled against Qt version 5.5.1
[ INFO] [1550906920.881034061]: compiled against OGRE version 1.9.0 (Ghadamon)
[ INFO] [1550906921.026308405]: Loading robot model 'ur5'...
[ WARN] [1550906921.026345321]: Skipping virtual joint 'fixed_base' because its child frame 'base_lin
k' does not match the URDF frame 'world'
[ INFO] [1550906921.026365177]: No root/virtual joint specified in SRDF. Assuming fixed joint
[ INFO] [1550906921.085087126]: Publishing maintained planning scene on 'monitored_planning_scene'
[ INFO] [1550906921.088347061]: MoveGroup debug mode is ON
Starting context monitors...
[ INFO] [1550906921.088390026]: Starting scene monitor
[ INFO] [1550906921.091093141]: Listening to '/planning_scene'
[ INFO] [1550906921.091116564]: Starting world geometry monitor
[ INFO] [1550906921.093945567]: Listening to '/collision_object' using message notifier with target f
rame '/world '
[ INFO] [1550906921.096605873]: Listening to '/planning_scene_world' for planning scene world geometr
y
[ INFO] [1550906921.120120233]: Listening to '/camera/depth_registered/points' using message filter w
ith target frame '/world '
[ INFO] [1550906921.125800170]: Listening to '/attached_collision_object' for attached collision obje
cts
Context monitors started.
[ INFO] [1550906921.148966001]: Initializing OMPL interface using ROS parameters
[ INFO] [1550906921.177333022]: Using planning interface 'OMPL'
[ INFO] [1550906921.182271283]: Param 'default_workspace_bounds' was not set. Using default value: 10
[ INFO] [1550906921.182854621]: Param 'start_state_max_bounds_error' was set to 0.1
[ INFO] [1550906921.183335277]: Param 'start_state_max_dt' was not set. Using default value: 0.5
[ INFO] [1550906921.183929666]: Param 'start_state_max_dt' was not set. Using default value: 0.5
[ INFO] [1550906921.184396735]: Param 'jiggle_fraction' was set to 0.05
[ INFO] [1550906921.184902163]: Param 'max_sampling_attempts' was not set. Using default value: 100
[ INFO] [1550906921.184961051]: Using planning request adapter 'Add Time Parameterization'
[ INFO] [1550906921.184981296]: Using planning request adapter 'Fix Workspace Bounds'
[ INFO] [1550906921.185002667]: Using planning request adapter 'Fix Start State Bounds'
[ INFO] [1550906921.185022734]: Using planning request adapter 'Fix Start State In Collision'
[ INFO] [1550906921.185042413]: Using planning request adapter 'Fix Start State Path Constrai[68/897]
[ INFO] [1550906921.195717032]: Loading robot model 'ur5'...
[ WARN] [1550906921.195754782]: Skipping virtual joint 'fixed_base' because its child frame 'base_lin
k' does not match the URDF frame 'world'
[ INFO] [1550906921.195766722]: No root/virtual joint specified in SRDF. Assuming fixed joint
[ INFO] [1550906921.246311856]: Loading robot model 'ur5'...
[ WARN] [1550906921.246345437]: Skipping virtual joint 'fixed_base' because its child frame 'base_lin
k' does not match the URDF frame 'world'
[ INFO] [1550906921.246360269]: No root/virtual joint specified in SRDF. Assuming fixed joint
[ WARN] [1550906921.258415847]: Unknown joint model group: panda_arm_hand
[ INFO] [1550906921.258779156]: Fake controller 'fake_manipulator_controller' with joints [ shoulder_
pan_joint shoulder_lift_joint elbow_joint wrist_1_joint wrist_2_joint wrist_3_joint ]
[ INFO] [1550906921.259300633]: Fake controller 'fake_endeffector_controller' with joints [ ]
[ INFO] [1550906921.259801188]: Returned 2 controllers in list
[ INFO] [1550906921.279309046]: Trajectory execution is managing controllers
Loading 'move_group/ApplyPlanningSceneService'...
Loading 'move_group/ClearOctomapService'...
Loading 'move_group/MoveGroupCartesianPathService'...
Loading 'move_group/MoveGroupExecuteService'...
Loading 'move_group/MoveGroupExecuteTrajectoryAction'...
Loading 'move_group/MoveGroupGetPlanningSceneService'...
Loading 'move_group/MoveGroupKinematicsService'...
Loading 'move_group/MoveGroupMoveAction'...
Loading 'move_group/MoveGroupPickPlaceAction'...
Loading 'move_group/MoveGroupPlanService'...
Loading 'move_group/MoveGroupQueryPlannersService'...
Loading 'move_group/MoveGroupStateValidationService'...
[ INFO] [1550906921.365204183]: 

********************************************************
* MoveGroup using: 
*     - ApplyPlanningSceneService
*     - ClearOctomapService
*     - CartesianPathService
*     - ExecuteTrajectoryService
*     - ExecuteTrajectoryAction
*     - GetPlanningSceneService
*     - KinematicsService
*     - MoveAction
*     - PickPlaceAction
*     - MotionPlanService
*     - QueryPlannersService
*     - StateValidationService
********************************************************

[ INFO] [1550906921.365270425]: MoveGroup context using planning plugin ompl_interface/OMPLPlanner
[ INFO] [1550906921.365295953]: MoveGroup context initialization complete

You can start planning now!

[ INFO] [1550906921.721673688]: Stereo is NOT SUPPORTED
[ INFO] [1550906921.721770291]: OpenGl version: 4.5 (GLSL 4.5).
[ INFO] [1550906925.205201396]: Loading robot model 'ur5'...
[ WARN] [1550906925.205263961]: Skipping virtual joint 'fixed_base' because its child frame 'base_lin
k' does not match the URDF frame 'world'
[ INFO] [1550906925.205295476]: No root/virtual joint specified in SRDF. Assuming fixed joint
[ INFO] [1550906925.248395877]: Loading robot model 'ur5'...
[ WARN] [1550906925.248430391]: Skipping virtual joint 'fixed_base' because its child frame 'base_lin
k' does not match the URDF frame 'world'
[ INFO] [1550906925.248446112]: No root/virtual joint specified in SRDF. Assuming fixed joint [9/897]
[ INFO] [1550906925.331030951]: Starting scene monitor
[ INFO] [1550906925.338229751]: Listening to '/move_group/monitored_planning_scene'
[ INFO] [1550906925.651735730]: Constructing new MoveGroup connection for group 'manipulator' in name
space ''
[ WARN] [1550906926.468165115]: 
Deprecation warning: Trajectory execution service is deprecated (was replaced by an action).
Replace 'MoveGroupExecuteService' with 'MoveGroupExecuteTrajectoryAction' in move_group.launch
[ INFO] [1550906926.474276634]: Ready to take commands for planning group manipulator.
[ INFO] [1550906926.474321847]: Looking around: no
[ INFO] [1550906926.474349398]: Replanning: no
[ WARN] [1550906926.489031417]: Interactive marker 'EE:goal_ee_link' contains unnormalized quaternion
s. This warning will only be output once but may be true for others; enable DEBUG messages for ros.rv
iz.quaternions to see more details.
[ INFO] [1550906930.846929478]: Loading robot model 'ur5'...
[ WARN] [1550906930.847038033]: Skipping virtual joint 'fixed_base' because its child frame 'base_lin
k' does not match the URDF frame 'world'
[ INFO] [1550906930.847086305]: No root/virtual joint specified in SRDF. Assuming fixed joint
[ INFO] [1550906930.938000488]: Loading robot model 'ur5'...
[ WARN] [1550906930.938100835]: Skipping virtual joint 'fixed_base' because its child frame 'base_lin
k' does not match the URDF frame 'world'
[ INFO] [1550906930.938148305]: No root/virtual joint specified in SRDF. Assuming fixed joint
[ WARN] [1550906931.733212297]: 
Deprecation warning: Trajectory execution service is deprecated (was replaced by an action).
Replace 'MoveGroupExecuteService' with 'MoveGroupExecuteTrajectoryAction' in move_group.launch
[ INFO] [1550906931.739792429]: Ready to take commands for planning group manipulator.
[ WARN] [1550906931.813013396]: 
Deprecation warning: Trajectory execution service is deprecated (was replaced by an action).
Replace 'MoveGroupExecuteService' with 'MoveGroupExecuteTrajectoryAction' in move_group.launch
[ INFO] [1550906931.819572995]: Ready to take commands for planning group manipulator.
[ INFO] [1550906931.821112005]: Reference frame: /world
[ INFO] [1550906931.821171603]: Reference frame: ee_link
[ INFO] [1550906931.821547473]: Visualizing plan 1 (pose goal) 
[ INFO] [1550906931.873914792]: Combined planning and execution request received for MoveGroup action
. Forwarding to planning and execution pipeline.
[ INFO] [1550906931.874443291]: Planning attempt 1 of at most 1
[ERROR] [1550906931.876450425]: manipulator: Attempted to set projection evaluator with respect to va
lue of joint 'shoulder_1_joint', but that joint is not known to the group 'manipulator'.
[ERROR] [1550906931.876513648]: manipulator: Attempted to set projection evaluator with respect to va
lue of joint 'shoulder_2_joint', but that joint is not known to the group 'manipulator'.
[ERROR] [1550906931.876565887]: manipulator: No valid joints specified for joint projection
[ INFO] [1550906931.876692445]: Planner configuration 'manipulator' will use planner 'geometric::RRTC
onnect'. Additional configuration parameters will be set when the planner is constructed.
[ INFO] [1550906931.877403103]: RRTConnect: Starting planning with 1 states already in datastructure
[ INFO] [1550906931.901985030]: RRTConnect: Created 5 states (2 start + 3 goal)
[ INFO] [1550906931.902044020]: Solution found in 0.024833 seconds
[ INFO] [1550906931.917842251]: SimpleSetup: Path simplification took 0.015656 seconds and changed fr
om 4 to 2 states
[ INFO] [1550906931.974327897]: Fake execution of trajectory
[ INFO] [1550906934.473800415]: Completed trajectory execution with status SUCCEEDED ...
[ WARN] [1550906936.906830901]: 
Deprecation warning: Trajectory execution service is deprecated (was replaced by an action).
Replace 'MoveGroupExecuteService' with 'MoveGroupExecuteTrajectoryAction' in move_group.launch
[ INFO] [1550906936.915138630]: Ready to take commands for planning group manipulator.
[ INFO] [1550906937.927812579]: Didn't received robot state (joint angles) with recent timestamp with
in 1 seconds.
Check clock synchronization if your are running ROS across multiple machines!
[ERROR] [1550906937.927888621]: Failed to fetch current robot state
[inf3480_move_robot-5] process has died [pid 19152, exit code -11, cmd /home/hychiang/ur5_ws/devel/li
b/ur5_inf3480/inf3480_move_robot __name:=inf3480_move_robot __log:=/home/hychiang/.ros/log/087c5adc-3
718-11e9-a629-ac220b8958ba/inf3480_move_robot-5.log].
log file: /home/hychiang/.ros/log/087c5adc-3718-11e9-a629-ac220b8958ba/inf3480_move_robot-5*.log

Also, my robot stucked at the position: image

class MoveRobot
{
        MoveRobot()
        {
                /* This sleep is ONLY to allow Rviz to come up */
                sleep(10.0);

                moveit::planning_interface::MoveGroup group("manipulator");

                // Pre-programmed robot move
                moveRobotToHome();
                moveRobotToHomeWithFloor();
                moveRobotCartesianPath();
                 ...
                 ...
        }

Does anyone have the experimence of fixing these warnings and errors? Thanks

hychiang-git commented 5 years ago

As I restarted my computer, the error [ERROR] [1550906931.876450425]: manipulator: Attempted to set projection evaluator with respect to va lue of joint 'shoulder_1_joint', but that joint is not known to the group 'manipulator'. vanished.

Also, I fixed some warnings:

However, the robot is still stuck at the position and does not move as it planned.

Here is my code

#include <moveit/move_group_interface/move_group.h>                                         [255/419]
#include <moveit/planning_scene_interface/planning_scene_interface.h>

#include <moveit_msgs/DisplayRobotState.h>
#include <moveit_msgs/DisplayTrajectory.h>

#include <moveit_msgs/AttachedCollisionObject.h>
#include <moveit_msgs/CollisionObject.h>

int main(int argc, char **argv)
{
  ros::init(argc, argv, "move_group_interface_tutorial");
  ros::NodeHandle node_handle;  
  ros::AsyncSpinner spinner(1);
  spinner.start();

  /* This sleep is ONLY to allow Rviz to come up */
  sleep(20.0);

  // BEGIN_TUTORIAL
  // 
  // Setup
  // ^^^^^
  // 
  // The :move_group_interface:`MoveGroup` class can be easily 
  // setup using just the name
  // of the group you would like to control and plan for.
  moveit::planning_interface::MoveGroup group("manipulator");

  // We will use the :planning_scene_interface:`PlanningSceneInterface`
  // class to deal directly with the world.
  moveit::planning_interface::PlanningSceneInterface planning_scene_interface;  

  // (Optional) Create a publisher for visualizing plans in Rviz.
  ros::Publisher display_publisher = node_handle.advertise<moveit_msgs::DisplayTrajectory>("/move_gro
up/display_planned_path", 1, true);
  moveit_msgs::DisplayTrajectory display_trajectory;

  // Getting Basic Information
  // ^^^^^^^^^^^^^^^^^^^^^^^^^
  //
  // We can print the name of the reference frame for this robot.
  ROS_INFO("Reference frame: %s", group.getPlanningFrame().c_str());

  // We can also print the name of the end-effector link for this group.
  ROS_INFO("Reference frame: %s", group.getEndEffectorLink().c_str());

  // Planning to a Pose goal
  // ^^^^^^^^^^^^^^^^^^^^^^^
  // We can plan a motion for this group to a desired pose for the 
  // end-effector.
  geometry_msgs::Pose target_pose1;
  target_pose1.orientation = tf::createQuaternionMsgFromRollPitchYaw(0.0, 0.0, 0.0);
  target_pose1.position.x = 0.10;
  target_pose1.position.y = 0.25;
  target_pose1.position.z = 0.50;
  group.setPoseTarget(target_pose1);

  // Now, we call the planner to compute the plan
  // and visualize it.
  // Note that we are just planning, not asking move_group 
  // to actually move the robot.
  moveit::planning_interface::MoveGroup::Plan my_plan;
  moveit::planning_interface::MoveItErrorCode success = group.plan(my_plan);

  ROS_INFO("Visualizing plan 1 (pose goal) %s",success?"":"FAILED");    
  /* Sleep to give Rviz time to visualize the plan. */
  sleep(5.0);

  // Visualizing plans
  // ^^^^^^^^^^^^^^^^^
  // Now that we have a plan we can visualize it in Rviz.  This is not
  // necessary because the group.plan() call we made above did this
  // automatically.  But explicitly publishing plans is useful in cases that we
  // want to visualize a previously created plan.
  if (1)
  {
    ROS_INFO("Visualizing plan 1 (again)");    
    display_trajectory.trajectory_start = my_plan.start_state_;
    display_trajectory.trajectory.push_back(my_plan.trajectory_);
    display_publisher.publish(display_trajectory);
    /* Sleep to give Rviz time to visualize the plan. */
    sleep(5.0);
  }

  // Moving to a pose goal
  // ^^^^^^^^^^^^^^^^^^^^^
  //
  // Moving to a pose goal is similar to the step above
  // except we now use the move() function. Note that
  // the pose goal we had set earlier is still active 
  // and so the robot will try to move to that goal. We will
  // not use that function in this tutorial since it is 
  // a blocking function and requires a controller to be active
  // and report success on execution of a trajectory.

  /* Uncomment below line when working with a real robot*/
  //group.move();
  group.execute(my_plan);

  ros::shutdown();  
  return 0;
}

ur5_stuck

Does anyone ever encounter this issue?

Thanks

jmiseikis commented 5 years ago

It looks like there might be a possible change on naming convention of the UR5 joints in the new ROS/UR drivers. You can try to check the URDF file of the robot and see if the joint names are the same as in the program. Unfortunately, I'm unable to check that myself at the moment...

hychiang-git commented 5 years ago

I fix the problem by modifying the ur5_move.launch. Here is the modified launch file.

<launch>
        <!-- If sim=false, then robot_ip is required -->
        <arg name="sim" default="true" />
        <arg name="robot_ip" unless="$(arg sim)" />
        <!-- By default, we are not in debug mode -->
        <arg name="debug" default="false" />

        <!-- Limited joint angles are used. Prevents complex robot configurations and makes the planner more efficient -->
        <arg name="limited" default="true" />

        <!-- Launch ur_gazebo -->
        <include file="$(find ur_gazebo)/launch/ur5.launch">
          <arg name="limited" default="true" />
        </include>

        <!-- Load UR5 URDF file - robot description file -->
        <include file="$(find ur5_moveit_config)/launch/ur5_moveit_planning_execution.launch">
          <arg name="sim" value="$(arg sim)" />
          <arg name="limited" value="$(arg limited)" />
        </include>

        <!-- Launch the RViz visualizer -->
        <include file="$(find ur5_moveit_config)/launch/moveit_rviz.launch">
            <arg name="config" value="true" />
        </include>

        <!-- Optionally, you can launch a database to record all the activities -->
        <include file="$(find ur5_moveit_config)/launch/default_warehouse_db.launch" />

        <!-- Launch our own script -->
        <node name="move_group_interface_tutorial" pkg="ur5_move" type="move_group_interface_tutorial" respawn="false" output="screen"></node>
    </launch>