O'Reilly logo

Robot Operating System Cookbook by Kumar Bipin

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Executing a trajectory

So, at this point, we've seen some methods that allow us to plan a trajectory with Python code. But, what about executing this trajectory with the real robot? In fact, it's very simple. In order to execute a trajectory, we just need to call the go() function from the planning group, like this:

group.go(wait=True) 

By executing this line of code, we will be telling our robot to execute the last trajectory that has been set for the planning group.

First of all, we'll need to launch the MoveIt RViz environment by executing the following command:

$ roslaunch fetch_moveit_config fetch_planning_execution.launch  

We will create a new Python script called execute_trajectory.py and copy the code from joint_planning.py before ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required