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. |
Pendulum Examples
Description: Simple pendulums examples.Tutorial Level: INTERMEDIATE
Single Link Example
A very simple single link example. The single link is attached to the world via a hinge joint.
In order to run this demo, please run the following roslaunch files in separate windows:
rosmake pr2_examples_gazebo roslaunch pr2_examples_gazebo single_link.launch
A controller named test_controller is loaded by default, try
rosrun pr2_controller_manager pr2_controller_manager list
and you should see the following output:
test_controller ( running )
To send a position command to the test_controller, publish the desired position using the rostopic command
rostopic pub /test_controller/command std_msgs/Float64 .5
To visualize in rviz, make sure pr2_controller_manager is compiled
rosmake pr2_controller_manager
and start robot_state_publisher by issuing the following command:
roslaunch pr2_controller_manager controller_manager.launch
then make sure rviz is compiled and start rviz:
rosrun rviz rviz
Finally, set Fixed Frame to base_block under Global Options panel.
Dual Link Pendulum Example
A simulation of two links attached by a single hinge joint - a simple pendulum.
In order to run this demo, please run the following roslaunch files in separate windows:
rosmake pr2_examples_gazebo roslaunch pr2_examples_gazebo dual_link.launch
Multiple Link Pendulum Example
A simulation of multiple links attached by hinge joints.
In order to run this demo, please run the following roslaunch files in separate windows:
rosmake pr2_examples_gazebo roslaunch pr2_examples_gazebo multi_link.launch