The simulations are done using the simulation framework SOFA. Binaries of SOFA with the required and optional plugins are available here. If you compile SOFA, checkout the following source code:
- SOFA on branch master
- SofaPython3 plugin for SOFA on branch master
- BeamAdapter plugin on branch master
- SoftRobots plugin on branch master
- STLIB plugin on branch master
- SoftRobots.Inverse plugin for SOFA to solve the inverse kinematics of the robot
- ROS2 to send commands to the robot from an external program (last tested with ROS2 Humble)
- Run the simulation. In your terminal:
~$ cd TIRREX.MicroParallel
~/TIRREX.MicroParallel$ runSofa scene.py
~/TIRREX.MicroParallel$ runSofa sceneInverseKinematics.py # for inverse resolution
- To use ROS2, first source it in your terminal. For instance:
~/TIRREX.MicroParallel$ source /opt/ros/humble/setup.bash
To enable ROS, uncomment the following line in file scene.py
:
# Uncomment these lines to enable ROS communication
from controller import SofaROSInterface
rootnode.addObject(SofaROSInterface(robot.node))
The geometric and mechanical parameters of the robot can be changed from the file params.py
.
Two topics are created on the node SOFASimulation:
- the topic /TIRREX/microparallel/simulationData, on which the actual dofs values are being published at each time step of the simulation
- and the topic /TIRREX/microparallel/interfaceData, on which the simulation is subscribing and looking for commands
The simulation expects the following commands (see file controller.py
):
# A list of 4 elements
[ q0, # leg0 displacement in mm
q1, # leg1 displacement in mm
q2, # leg2 displacement in mm
q3, # leg3 displacement in mm
]
Eulalie Coevoet & Mohamed Chakroune