This Github repository provides a base inverted pendulum simulation to be used as-is for the purposes of this assignment
Send the assignment to: ishan.b@octobotics.tech
pip install pygame
sudo apt-get install python3-catkin-tools
- clone the repository
git clone git@github.com:octobotics/Octobotics_Coding_Assignment.git
- navigate to the repository directory
cd Octobotics_Coding_Assignment
- build the project
catkin build
- source the workspace
source devel/setup.bash
- launch the simulation using roslaunch
roslaunch inverted_pendulum_sim inverted_pendulum_sim.launch
- pull the image
docker pull nil69/inverted_pendulum_sim_image:latest
- ensure you have the necessary X11 utilities installed on your host machine. On a Debian-based system, you can install them using:
sudo apt-get install x11-xserver-utils
- you need to allow the Docker container to use your host's X server. This can be done by running:
xhost +local:docker
- run the docker image
docker run -it --env="DISPLAY" --env="QT_X11_NO_MITSHM=1" --volume="/tmp/.X11-unix:/tmp/.X11-unix:rw" nil69/inverted_pendulum_sim_image
- /inverted_pendulum/current_state (inverted_pendulum_sim/CurrentState) - Publishes the current state of the inverted pendulum at 100 Hz
- /inverted_pendulum/control_force (inverted_pendulum_sim/ControlForce) - Subscribes to the control force input to the inverted pendulum
- /inverted_pendulum/set_params (inverted_pendulum_sim/SetParams - Sets the parameters and initial conditions of the inverted pendulum