ROS Resources: Documentation | Support | Discussion Forum | Index | Service Status | ros @ Robotics Stack Exchange
Ask Your Question

Easiest way to control an inverted pendulum

asked 2013-06-26 10:19:41 -0500

Albatross gravatar image

updated 2013-06-27 06:23:23 -0500

I'm trying to create a simple model for a controller of an inverted pendulum.

What I have so far is a model that receives position and velocity from the pendulum, and outputs motor commands. What I want is a physical model that this controller can interact with (using ROS topics to communicate between the two)

I have a feeling this should be relatively simple, but I can't seem to find a good place to start. I think all I need is a rod with mass/intertia with a revolute joint attached to a cart, that can move linearly.

What would you suggest as the best way to set up this environment? I've looked at (armature actuators) in MORSE, but I'm not sure how to build a model that can use them properly.

Any help or suggestions will be much appreciated! :)

I've mostly been using MORSE/Blender, and I'd prefer to keep working with that simulator, but a solution using Gazebo would be okay as well

(I'm using ROS Fuerte on Debian Jessie, with Gazebo 1.7 and MORSE 1.0.1)


Just to follow up in case anyone else runs into a similar problem, here is a list of tutorials that I've found to be helpful:

Accessing and modifying joint state: Revolute joint for the pendulum: Creating a subscriber for ROS messages: Pendulum control for newer version of Gazebo (doesn't work for me, but might for you):

edit retag flag offensive close merge delete


Hello! Did a MORSE implementation ever get implemented? (and did you have to install MORSE from source to get this done?)

SL Remy gravatar image SL Remy  ( 2015-01-20 06:38:56 -0500 )edit

1 Answer

Sort by ยป oldest newest most voted

answered 2013-06-26 10:44:32 -0500

davinci gravatar image

Look here:

(be aware that Gazebo and ROS currently have some issues, not all the tutorials you will find will work on every Gazebo version)

edit flag offensive delete link more


Thanks! That helped a lot. Using pieces from that and various other tutorials, I've been able to put the pendulum together and send ROS messages to the plugin. What I'm stuck on now is how to use those messages to change the force on the joint, and how to read position and velocity. Any ideas?

Albatross gravatar image Albatross  ( 2013-06-27 06:11:54 -0500 )edit

actually, I think I've figured it out now, was using stuff from a tutorial for a newer version of gazebo to access the joints, going to follow just the one you mentioned, and the syntax should work

Albatross gravatar image Albatross  ( 2013-06-27 06:20:12 -0500 )edit

Question Tools


Asked: 2013-06-26 10:19:41 -0500

Seen: 2,068 times

Last updated: Jun 27 '13