(!) 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

simulator_gazebo/Tutorials/single_link_snapshot.png

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. simulator_gazebo/Tutorials/single_link_rviz_snapshot.png

simulator_gazebo/Tutorials/dual_link_snapshot.png
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

simulator_gazebo/Tutorials/multi_link_snapshot.png
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


Wiki: pr2_simulator/Tutorials/Pendulums (last edited 2010-07-21 18:04:42 by hsu)