Please ask about problems and questions regarding this tutorial on answers.ros.org. Don't forget to include in your question the link to this page, the versions of your OS & ROS, and also add appropriate tags. |
Getting started
Description: Generating a simple trajectory from footprints.Keywords: pattern generator, humanoid, walk
Tutorial Level: BEGINNER
Contents
This tutorial explains how to generate reference trajectories using the half-steps pattern generator.
First, make sure that you have installed and compiled properly the ROS package.
Launching the generator node
1 # First, launch roscore if required:
2 roscore
3
4 # Then, launch the generator node:
5 rosrun halfsteps_pattern_generator generator
This node provides a service called getPath which generates reference trajectories from a set of footprints and other input data.
Generate the trajectories
In this tutorial, we will use the sample Python code called tutorial_getting_started.py which is provided in the sample directory of the package.
This Python code contains a client which will build a request for the getPath service and send it.
After launching the client, the following topics are available:
/com /footprints /left_foot /right_foot /zmp
These topics are useful to display the trajectories but it is not recommended to use them for other purposes.
If you need to retrieve the trajectories, use instead the parameter server. The generator node provides a walk_movement which is a serialized version of the movement as described in the walk_interfaces documentation.
You can then retrieve the serialized data using the roscpp API and instantiate a YamlReader object from the walk_interfaces package to retrieve the trajectories.
Displaying the trajectories
The generated data can be displayed using rviz. walk_msgs provides a useful default setup.
1 rosrun rviz rviz -d `rospack find walk_msgs`/walking_trajectories.vcg
Generating your own trajectories
To generate a different trajectory, you must copy the tutorial_getting_started.py into another Python file and change the input data.