4.4.1 Movelt! Commander
Course subject(s)
Module 4. Manipulation
In this lecture, we will learn how to move our robot arms with MoveIt! Commander.
Note: If you want to start MoveIt! commander in the context of the factory setting, you will have to execute: rosrun hrwros_week4 hrwros_moveit_commander_cmdline. This is necessary because we are operating with multiple robots in the factory simulation. Further details on this are beyond the scope of this course.
If the above command fails, just do the following inside the CCS:
- $ roscd hrwros_week4/scripts
- $ chmod +x hrwros_moveit_commander_cmdline
Note: If you want to execute the commands in this video, please first read the complete summary below the video, because you will need to start a number of packages in the right order.
Summary
MoveIt! Commander:
- Command line tool to send motion commands to the robot
- Starting command:
$ rosrun hrwros_week4 hrwros_moveit_commander_cmdline - Useful to test configuration
Basic commands:
- List all usable commands
$ help
- Select the “group” to use
$ use <group_name>
- Plan and execute motion from srdf
$ go <named_target>
- Plan and execute linear motions
$ go <up | down | left | right | forward | backward> <distance_in_m>
- Get current joint state and pose
$ current
- Execute multiple commands
$ load <path_to_script_file/scrip_file_name>
Let’s see the commands in action
Commands in action
First open the file hrwros_environment.launch in your favorite editor, outside the CCS.
Search and replace the string week4_moveit_config with name of the *_moveit_config package you just created. If you repeated exactly what was done in the video, this package will be called hrwros_moveit_config and should be in the $HOME/hrwros_ws/src folder.
Remember to change this string back to week4_moveit_config before starting the assignments.
Start the Gazebo simulation and verify if the robot arms and the turtlebot are correctly displayed.
$ roslaunch hrwros_gazebo hrwros_environment.launch
Run MoveIt! commander in a new terminal
$ source $HOME/hrwros_ws/devel/setup.bash
$ rosrun hrwros_week4 hrwros_moveit_commander_cmdline
List the possible set of commands with the help
command.
Initialize the desired robot group and move it! It is also useful to have a look at this post to get a perspective on what commands will work and what commands may not.
use robot1
go R1Up
go down 0.2
With the current
command, you can see the joint values and pose of the end effector.
Let’s try the load command and create the required script file.
Name the script and type commands outside the CCS in a regular terminal.
$ touch moveit_commander_test
$ gedit moveit_commander_test
For example, you can add the following commands in the script:
use robot2
go R2Up
go down 0.1
Then, switch back to the CCS where you started MoveIt! commander and use the following command:
load moveit_commander_test
and the robot corresponding to the planning group you have used in the script should start moving now.
Hello (Real) World with ROS - Robot Operating System by TU Delft OpenCourseWare is licensed under a Creative Commons Attribution-NonCommercial-ShareAlike 4.0 International License.
Based on a work at https://online-learning.tudelft.nl/courses/hello-real-world-with-ros-robot-operating-systems//.