- Author: linZHank
Using gazebo to simulate inverted pendulum and control through ROS The URDF model of the inverted pendulum and gazebo model spawn were refered to this tutorial Thanks to Matthew Chan and Arthur Juliani for their brilliant tutorials.
My configuration was Ubuntu 16.04, ROS-Kinetic and Gazebo-7.0. Other combinations of Linux, ROS and Gazebo may work, but not guaranteed.
- cd to the
/srcdirectory in ROS workspace (e.g.cd ~/ros_ws/src) git clone https://github.com/linZHank/invpend_experiment.gitcatkin_make, orcarkin buildif you were using Catkin Command Line Toolssource ~/ros_ws/devel/setup.bash- run
roslaunch invpend_description invpend_rviz.launchto check the model in rviz; runroslaunch invpend_control load_invpend.launchto spawn the model in gazebo and initiate ros_control
All python scripts is located at /your/path/to/ros_ws/src/invpend_experiment/invpend_control/scripts.
cartpole_v0.pyandcartpole_v1configures the model to be a reinforcement learning ready enviroment.test_env.pyis a good starting point to familiarize this environment. Currently, sending random command and sinusoidal command to the cart through velocity control are available/qtable_train.pyruns Q-learning algorithm on the cart-pole, however parameters are undertuned at current stage.qtable_eval.pyevaluates the Q table learned byqtable_train.py
Training Demo Video
Evaluation Demo


