The XML file for the Panda robot simulation is generated from the URDF and meshes (link: https://github.com/StanfordASL/PandaRobot.jl). The torque and position controls are implemented in the XML file (limits taken from: https://frankaemika.github.io/docs/control_parameters.html#constants). The simulation can be used with the MuJoCo simulator (recommended version: 2.0.2.8, for installation details and licenses see the MujoCo repository).
To run the simulation, navigate to ~/mujoco/mujoco200/bin
in the terminal and execute
./simulate /path/to/franka-emika-panda-simulation/pandaenv/envs/assets/Panda_xml/model_actuate.xml
We implemented a simple Gym environment to interact with the robot. The actions pace consists of the joint torques. The Gym environment can be installed by executing
pip install .
To be able to also run experiments with GoSafeOpt, execute: pip install .[gosafeopt]
To import simulation:
import pandaenv
import gym
env=gym.make("PandaEnvPath-v0")
Testing:
python3 test_env.py
can be run to visualize a simple impedance controller.
We consider 2 tasks:
- Eight dimensional Task: Reaching a desired positive task
- Eleven dimensional Task: Path following task.
To run SafeOpt and GoSafeOpt, installation wi code is required (EIC additionally requires https://github.com/alonrot/classified_regression ).
A. Running Eight dimensional Task
command: python3 Eight_dimension_task/8D_task.py method
replacing method with either GoSafeOpt or SafeOpt
B. Running Eleven dimensional Task
command: python3 Eleven_dimension_task/11D_task.py method
replacing method with either GoSafeOpt or SafeOpt or EIC (note that for running experiments with EIC (expected improvement with constraints), the EIC code is required)
setup.py
: Installation fileosc_controller.py
: Class which defines functions used for operational space controllers (e.g. Getting jacobian, mass matrix etc.)test.py
andtest_env_path.py
: File used for testing the 8D task and 11D task environment respectively.Eight_dimension_task
andEleven_dimension_task
: Contains files used to run experiments for 8D and 11D tasks respectively.
URDF files: https://github.com/StanfordASL/PandaRobot.jl
Simulation and Experiments: Bhavya Sukhija
The code is licenced under the MIT license and free to use by anyone without any restrictions.