ROS_movieIt入门总结

 简单安装方法:(我的系统是hydro)
sudo apt-get install ros-hydro-moveit-full

已经装了turtlebotArm


每次执行程序都要:

sudo chmod 666 /dev/ttyUSB0


入门参考:
http://www.ncnynl.com/archives/201611/1112.html
http://www.ncnynl.com/archives/201610/947.html
http://wiki.ros.org/turtlebot_arm_moveit_demos/Tutorials/UseArmWithMoveIt


   roslaunch turtlebot_arm_moveit_config turtlebot_arm_moveit.launch sim:=false --screen

终端出现绿色字体All is well! Everyone is happy! You can start planning now!

前面出现错误也没关系

会打开Rviz的界面,在context,Port选0,然后connect。在plan,可以选择机械臂初末状态,然后plan。虚拟的界面会有机械臂运动规划动态图。

在新终端输入 rostopic list

/attached_collision_object

/camera/depth_registered/points
/collision_object
/gripper_controller/gripper_action/cancel
/gripper_controller/gripper_action/feedback
/gripper_controller/gripper_action/goal
/gripper_controller/gripper_action/result
/gripper_controller/gripper_action/status
/joint_states
/move_group/cancel
/move_group/display_contacts
/move_group/display_planned_path
/move_group/feedback
/move_group/goal
/move_group/monitored_planning_scene
/move_group/ompl/parameter_descriptions
/move_group/ompl/parameter_updates
/move_group/planning_scene_monitor/parameter_descriptions
/move_group/planning_scene_monitor/parameter_updates
/move_group/result
/move_group/status
/planning_scene
/planning_scene_world
/recognized_object_array
/rosout
/rosout_agg
/rviz_isi_22846_1916269086954356970/motionplanning_planning_scene_monitor/parameter_descriptions
/rviz_isi_22846_1916269086954356970/motionplanning_planning_scene_monitor/parameter_updates
/rviz_moveit_motion_planning_display/robot_interaction_interactive_marker_topic/feedback
/rviz_moveit_motion_planning_display/robot_interaction_interactive_marker_topic/update
/rviz_moveit_motion_planning_display/robot_interaction_interactive_marker_topic/update_full
/target_pose
/tf
/tf_static
/trajectory_execution_event

   roslaunch turtlebot_arm_bringup arm.launch --screen

终端出现:

[INFO] [WallTime: 1486624865.254494] Started ArbotiX connection on port /dev/ttyUSB0.
[INFO] [WallTime: 1486624865.357533] Started FollowController (arm_controller). Joints: ['arm_shoulder_pan_joint', 'arm_shoulder_lift_joint', 'arm_elbow_flex_joint', 'arm_wrist_flex_joint'] on C1
[INFO] [WallTime: 1486624865.361463] ArbotiX connected.


前面出现错误也没关系

然后plan。虚拟的界面会有机械臂运动规划动态图。

在新终端输入 rostopic list
/arm_controller/command
/arm_controller/follow_joint_trajectory/cancel
/arm_controller/follow_joint_trajectory/feedback
/arm_controller/follow_joint_trajectory/goal
/arm_controller/follow_joint_trajectory/result
/arm_controller/follow_joint_trajectory/status
/arm_elbow_flex_joint/command
/arm_shoulder_lift_joint/command
/arm_shoulder_pan_joint/command
/arm_wrist_flex_joint/command

/attached_collision_object
/camera/depth_registered/points
/collision_object
/diagnostics
/gripper_controller/gripper_action/cancel
/gripper_controller/gripper_action/feedback
/gripper_controller/gripper_action/goal
/gripper_controller/gripper_action/result
/gripper_controller/gripper_action/status
/gripper_joint/command
/joint_states
/move_group/cancel
/move_group/display_contacts
/move_group/display_cost_sources
/move_group/display_grasp_markers
/move_group/display_planned_path
/move_group/feedback
/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
/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
/recognized_object_array
/rosout
/rosout_agg
/rviz_isi_28235_6071117680861277249/motionplanning_planning_scene_monitor/parameter_descriptions
/rviz_isi_28235_6071117680861277249/motionplanning_planning_scene_monitor/parameter_updates
/rviz_moveit_motion_planning_display/robot_interaction_interactive_marker_topic/feedback
/rviz_moveit_motion_planning_display/robot_interaction_interactive_marker_topic/update
/rviz_moveit_motion_planning_display/robot_interaction_interactive_marker_topic/update_full
/target_pose
/tf
/tf_static
/trajectory_execution_event

其中:/arm_shoulder_pan_joint/command

/arm_shoulder_lift_joint/command

/arm_elbow_flex_joint/command
/arm_wrist_flex_joint/command

/gripper_joint/command

为机械臂各个关节控制的话题,需要外部发送,可通过以下方式命令:

打开新终端

rostopic pub -1 /arm_shoulder_pan_joint/command std_msgs/Float64 0.5

/arm_shoulder_pan_joint/command是话题名称,代表舵机关节

std_msgs/Float64是话题类型

0.5 是舵机转动的弧度

但是舵机并没有反应

我猜是因为 turtlebot_arm_moveit_config turtlebot_arm_moveit.launch文件有点不稳定,或者是因为为用的是usb2dynamical

解决方法:用http://blog.csdn.net/hanshuning/article/details/54896995中的

cd ~/R2017_ws

source devel/setup.bash

roslaunch dynamixel_tutorials controller_manager.launch

出现以下错误也没有关系

[ERROR] [WallTime: 1486626183.027882] Exception thrown while getting attributes for motor 2 - Invalid response received from motor 2. Wrong packet prefix []
[ERROR] [WallTime: 1486626183.106159] Exception thrown while getting attributes for motor 3 - Invalid response received from motor 3. Wrong packet prefix []
[ERROR] [WallTime: 1486626183.278276] Exception thrown while getting attributes for motor 5 - 59904
[ERROR] [WallTime: 1486626183.280801] Exception thrown while getting attributes for motor 5 - Invalid response received from motor 5. [Errno 11] Resource temporarily unavailable

再进行舵机控制就可以。

rostopic pub -1 /arm_shoulder_pan_joint/command std_msgs/Float64 0.5

此时就是关掉dynamixel_tutorials controller_manager.launch也没关系。

rostopic list
/arm_controller/command
/arm_controller/follow_joint_trajectory/cancel
/arm_controller/follow_joint_trajectory/feedback
/arm_controller/follow_joint_trajectory/goal
/arm_controller/follow_joint_trajectory/result
/arm_controller/follow_joint_trajectory/status
/arm_elbow_flex_joint/command
/arm_shoulder_lift_joint/command
/arm_shoulder_pan_joint/command
/arm_wrist_flex_joint/command
/attached_collision_object
/camera/depth_registered/points
/collision_object
/diagnostics
/gripper_controller/gripper_action/cancel
/gripper_controller/gripper_action/feedback
/gripper_controller/gripper_action/goal
/gripper_controller/gripper_action/result
/gripper_controller/gripper_action/status
/gripper_joint/command
/joint_states
/motor_states/pan_tilt_port
/move_group/cancel
/move_group/display_contacts
/move_group/display_cost_sources
/move_group/display_grasp_markers
/move_group/display_planned_path
/move_group/feedback
/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
/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
/recognized_object_array
/rosout
/rosout_agg
/rviz_isi_28235_6071117680861277249/motionplanning_planning_scene_monitor/parameter_descriptions
/rviz_isi_28235_6071117680861277249/motionplanning_planning_scene_monitor/parameter_updates
/rviz_moveit_motion_planning_display/robot_interaction_interactive_marker_topic/feedback
/rviz_moveit_motion_planning_display/robot_interaction_interactive_marker_topic/update
/rviz_moveit_motion_planning_display/robot_interaction_interactive_marker_topic/update_full
/target_pose
/tf
/tf_static
/trajectory_execution_event


版权声明:本文为hanshuning原创文章,遵循CC 4.0 BY-SA版权协议,转载请附上原文出处链接和本声明。