diff --git a/tutorials/files/spacecraft/kth_spacecraft_simulator.png b/tutorials/files/spacecraft/kth_spacecraft_simulator.png new file mode 100644 index 00000000000..11fa8807d16 Binary files /dev/null and b/tutorials/files/spacecraft/kth_spacecraft_simulator.png differ diff --git a/tutorials/spacecraft_thrusters.md b/tutorials/spacecraft_thrusters.md new file mode 100644 index 00000000000..d9a6f7b9aeb --- /dev/null +++ b/tutorials/spacecraft_thrusters.md @@ -0,0 +1,83 @@ +\page spacecraft_thrusters Spacecraft thrusters + +## Spacecraft Thrusters Model + +To enable a seamless transition of space robotics control and planning schemes from simulation to real, we introduce +a spacecraft thrusters model in Gazebo. The model provides a very simple interface to a solenoid valve that controls +the flow of gas to the thruster. The thruster model is as follows: + +- force output equals maxThrust when the command is 1 +- force output equals 0 when the command is 0 +- force output is modeled according to a duty cycle with a given frequency, and thrust output is maximum at the ON state of the duty cycle + +In short, if the duty cycle signal is high, the solenoid valve behaves as a fully-opened thruster, providing maximum thrust. +If the duty cycle signal is low, the solenoid valve behaves as a fully-closed thruster, providing no thrust. + +## Setting up the SpacecraftThrusterModel plugin + +Here follows an example instance of the SpacecraftThrusterModel plugin in an SDF file: +```xml + + thruster_0_joint + thruster_0 + 0 + 10 + 1.4 + command/motor_speed + +``` + +In this case, each thruster link should be placed in the proper location in the spacecraft model. +An example of this goes below: +```xml + + -0.12 0.12 0.2 3.14159 1.57079 3.14159 + base_link + thruster_0 + + + 0 + 0 + + 0 0 1 + + -1e+16 + 1e+16 + + + + + + 0 + 0.2 + + + + + + true + 0 0 0 0 -0 0 + + 0 0 0 0 0 0 + 0.001 + + 1e-05 + 0 + 0 + 1e-05 + 0 + 1e-05 + + + +``` + +## Testing an implementation of a Spacecraft model + +Examples of spacecraft models with thrusters were implemented as part of the PX4-Autopilot SITL simulation. +The spacecraft model can be found in the `PX4-gazebo-models` repository, in the `models/spacecraft_2d/model.sdf` directory. + +For instructions on how to run the spacecraft model, please refer to the [PX4-Space-Systems](https://github.com/DISCOWER/PX4-Space-Systems) page. + +Below is a picture of the simulator: +![Spacecraft simulator](https://raw.githubusercontent.com/DISCOWER/gz-sim/pr-spacecraft-thrusters/tutorials/files/spacecraft/kth_spacecraft_simulator.png) \ No newline at end of file