Skip to content

Commit

Permalink
Added support for spacecraft thrusters (gazebosim#2431)
Browse files Browse the repository at this point in the history
Adds support for Spacecraft thrusters controlled with a duty cycle signal (such as PWM).

---------

Signed-off-by: Pedro Roque <[email protected]>
Signed-off-by: Benjamin Perseghetti <[email protected]>
Co-authored-by: Alejandro Hernández Cordero <[email protected]>
Co-authored-by: Benjamin Perseghetti <[email protected]>
  • Loading branch information
3 people authored Jul 19, 2024
1 parent f507ef2 commit d8eddd4
Show file tree
Hide file tree
Showing 11 changed files with 832 additions and 0 deletions.
77 changes: 77 additions & 0 deletions examples/worlds/ground_spacecraft_testbed.sdf
Original file line number Diff line number Diff line change
@@ -0,0 +1,77 @@
<?xml version="1.0" ?>
<!--
Spacecraft thruster plugin demo
Send commands to a single thruster:
gz topic -p 'normalized:[1.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0]' -t /dart/command/duty_cycle --msgtype gz.msgs.Actuators
-->
<sdf version="1.6">
<world name="ground_testbed">
<gravity>0 0 -9.8066</gravity>
<physics name="1ms" type="ignored">
<max_step_size>0.001</max_step_size>
<real_time_factor>1.0</real_time_factor>
</physics>
<plugin
filename="gz-sim-physics-system"
name="gz::sim::systems::Physics">
</plugin>
<plugin
filename="gz-sim-scene-broadcaster-system"
name="gz::sim::systems::SceneBroadcaster">
</plugin>
<plugin
filename="gz-sim-user-commands-system"
name="gz::sim::systems::UserCommands">
</plugin>
<plugin
filename="gz-sim-sensors-system"
name="gz::sim::systems::Sensors">
<render_engine>ogre2</render_engine>
</plugin>
<light type="directional" name="sun">
<cast_shadows>true</cast_shadows>
<pose>0 0 10 0 0 0</pose>
<diffuse>0.8 0.8 0.8 1</diffuse>
<specular>0.2 0.2 0.2 1</specular>
<attenuation>
<range>1000</range>
<constant>0.9</constant>
<linear>0.01</linear>
<quadratic>0.001</quadratic>
</attenuation>
<direction>-0.5 0.1 -0.9</direction>
</light>
<model name="ground_plane">
<static>true</static>
<link name="link">
<collision name="collision">
<geometry>
<plane>
<normal>0 0 1</normal>
<size>100 100</size>
</plane>
</geometry>
</collision>
<visual name="visual">
<geometry>
<plane>
<normal>0 0 1</normal>
<size>100 100</size>
</plane>
</geometry>
<material>
<ambient>0.8 0.8 0.8 1</ambient>
<diffuse>0.8 0.8 0.8 1</diffuse>
<specular>0.8 0.8 0.8 1</specular>
</material>
</visual>
</link>
</model>
<include>
<pose>0 0 0 0 0 0</pose>
<uri>https://fuel.gazebosim.org/1.0/proque/models/kth_freeflyer</uri>
</include>
</world>
</sdf>
51 changes: 51 additions & 0 deletions examples/worlds/spacecraft.sdf
Original file line number Diff line number Diff line change
@@ -0,0 +1,51 @@
<?xml version="1.0" ?>
<!--
Spacecraft thruster plugin demo
Send commands to a single thruster:
gz topic -p 'normalized:[1.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0]' -t /dart/command/duty_cycle --msgtype gz.msgs.Actuators
-->
<sdf version="1.6">
<world name="zero_g">
<gravity>0 0 0</gravity>
<physics name="1ms" type="ignored">
<max_step_size>0.001</max_step_size>
<real_time_factor>1.0</real_time_factor>
</physics>
<plugin
filename="gz-sim-physics-system"
name="gz::sim::systems::Physics">
</plugin>
<plugin
filename="gz-sim-scene-broadcaster-system"
name="gz::sim::systems::SceneBroadcaster">
</plugin>
<plugin
filename="gz-sim-user-commands-system"
name="gz::sim::systems::UserCommands">
</plugin>
<plugin
filename="gz-sim-sensors-system"
name="gz::sim::systems::Sensors">
<render_engine>ogre2</render_engine>
</plugin>
<light type="directional" name="sun">
<cast_shadows>true</cast_shadows>
<pose>0 0 10 0 0 0</pose>
<diffuse>0.8 0.8 0.8 1</diffuse>
<specular>0.2 0.2 0.2 1</specular>
<attenuation>
<range>1000</range>
<constant>0.9</constant>
<linear>0.01</linear>
<quadratic>0.001</quadratic>
</attenuation>
<direction>-0.5 0.1 -0.9</direction>
</light>
<include>
<pose>0 0 0 0 0 0</pose>
<uri>https://fuel.gazebosim.org/1.0/proque/models/dart/7</uri>
</include>
</world>
</sdf>
1 change: 1 addition & 0 deletions src/systems/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -152,6 +152,7 @@ add_subdirectory(rf_comms)
add_subdirectory(scene_broadcaster)
add_subdirectory(sensors)
add_subdirectory(shader_param)
add_subdirectory(spacecraft_thruster_model)
add_subdirectory(thermal)
add_subdirectory(thruster)
add_subdirectory(touch_plugin)
Expand Down
6 changes: 6 additions & 0 deletions src/systems/spacecraft_thruster_model/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
gz_add_system(spacecraft-thruster-model
SOURCES
SpacecraftThrusterModel.cc
PUBLIC_LINK_LIBS
gz-common${GZ_COMMON_VER}::gz-common${GZ_COMMON_VER}
)
Loading

0 comments on commit d8eddd4

Please sign in to comment.