MoveIt! Study Notes 2- MoveIt! Commander Scripting (command line control)

This blog post is mainly used to record the learning records of the MoveIt function package used for robot trajectory planning in ROS-Kinetic. 

The original English tutorial can be found at this link: http://docs.ros.org/en/kinetic/api/moveit_tutorials/html/doc/move_group_interface/move_group_interface_tutorial.html

 Quote: Commander Scripting: In the official Moveit tutorial, it is stipulated that the command line can be used to control the robot model in RVIZ, execute a specific posture and execute the corresponding trajectory. And can view the current robot coordinates and other information, the main function is to perform motion simulation before actually controlling the motion of the real robot.

Note: This tutorial is implemented based on a Tutorial Python script in the Moveit tutorial, so the application method and programming method in the actual project need to be studied in depth later.

Step1: First, open two command lines and execute the Launch file and Python script respectively:

roslaunch panda_moveit_config demo.launch
rosrun moveit_commander moveit_commander_cmdline.py

Step2:   Formulate the MoveGroup name controlled by the command line, and then use the current command to view the current robot status

use <panda_arm>
current

                          

Step3:  Life a variable C, and store the current robot state in c

rec c

Step4: After that, you can first transfer the robot state stored in the variable C to the goal, and modify the elements of the goal to modify the target position of the robot, and then use the go command to control the robot simulation

goal = c
goal[0] = 0.2
go goal

 Step5: Set a new goal posture, use plan and execute instructions to plan + execute trajectory

goal[0] = 0.2
goal[1] = 0.2
plan goal
execute

 

Guess you like

Origin blog.csdn.net/weixin_42503785/article/details/111829618