Create a virtual environment to house dependencies for this project. This makes it easy to remove all the dependencies later as the virtual environment can just be deleted.
If you want to use venv to make a virtual environment:
python3 -m venv /path/to/env
Activate the environment. You'll need to do this every time you open your terminal back up.
source /path/to/env/bin/activate
If you want to use conda to make a virtual environment:
conda create -n env_name
To activate:
conda activate env_name
Install the python dependencies.
pip install -r requirements.txt
Follow the cppzmq installation instructions. then build the example agent as follows:
mkdir build
cd build
cmake ..
make
You will need to start the server and a single agent in two separate terminals so they are both running at the same time. Also, if one dies you will have to close and restart the other one as well or it won't reconnect.
To run the server with animation of the pendulum enabled
python inverted_pendulum_server.py --animate
To run as fast as possible, omit the animate argument
python example_agent.py
If you've made changes to the agent, recompile it:
cd build
make
cd ..
Then run the agent with this command:
./build/example_agent_cpp