Skip to content

Commit d8eddd4

Browse files
Pedro-Roqueahcordebperseghetti
authored
Added support for spacecraft thrusters (gazebosim#2431)
Adds support for Spacecraft thrusters controlled with a duty cycle signal (such as PWM). --------- Signed-off-by: Pedro Roque <padr@kth.se> Signed-off-by: Benjamin Perseghetti <bperseghetti@rudislabs.com> Co-authored-by: Alejandro Hernández Cordero <ahcorde@gmail.com> Co-authored-by: Benjamin Perseghetti <bperseghetti@rudislabs.com>
1 parent f507ef2 commit d8eddd4

File tree

11 files changed

+832
-0
lines changed

11 files changed

+832
-0
lines changed
Lines changed: 77 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,77 @@
1+
<?xml version="1.0" ?>
2+
<!--
3+
Spacecraft thruster plugin demo
4+
5+
Send commands to a single thruster:
6+
7+
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
8+
-->
9+
<sdf version="1.6">
10+
<world name="ground_testbed">
11+
<gravity>0 0 -9.8066</gravity>
12+
<physics name="1ms" type="ignored">
13+
<max_step_size>0.001</max_step_size>
14+
<real_time_factor>1.0</real_time_factor>
15+
</physics>
16+
<plugin
17+
filename="gz-sim-physics-system"
18+
name="gz::sim::systems::Physics">
19+
</plugin>
20+
<plugin
21+
filename="gz-sim-scene-broadcaster-system"
22+
name="gz::sim::systems::SceneBroadcaster">
23+
</plugin>
24+
<plugin
25+
filename="gz-sim-user-commands-system"
26+
name="gz::sim::systems::UserCommands">
27+
</plugin>
28+
<plugin
29+
filename="gz-sim-sensors-system"
30+
name="gz::sim::systems::Sensors">
31+
<render_engine>ogre2</render_engine>
32+
</plugin>
33+
<light type="directional" name="sun">
34+
<cast_shadows>true</cast_shadows>
35+
<pose>0 0 10 0 0 0</pose>
36+
<diffuse>0.8 0.8 0.8 1</diffuse>
37+
<specular>0.2 0.2 0.2 1</specular>
38+
<attenuation>
39+
<range>1000</range>
40+
<constant>0.9</constant>
41+
<linear>0.01</linear>
42+
<quadratic>0.001</quadratic>
43+
</attenuation>
44+
<direction>-0.5 0.1 -0.9</direction>
45+
</light>
46+
<model name="ground_plane">
47+
<static>true</static>
48+
<link name="link">
49+
<collision name="collision">
50+
<geometry>
51+
<plane>
52+
<normal>0 0 1</normal>
53+
<size>100 100</size>
54+
</plane>
55+
</geometry>
56+
</collision>
57+
<visual name="visual">
58+
<geometry>
59+
<plane>
60+
<normal>0 0 1</normal>
61+
<size>100 100</size>
62+
</plane>
63+
</geometry>
64+
<material>
65+
<ambient>0.8 0.8 0.8 1</ambient>
66+
<diffuse>0.8 0.8 0.8 1</diffuse>
67+
<specular>0.8 0.8 0.8 1</specular>
68+
</material>
69+
</visual>
70+
</link>
71+
</model>
72+
<include>
73+
<pose>0 0 0 0 0 0</pose>
74+
<uri>https://fuel.gazebosim.org/1.0/proque/models/kth_freeflyer</uri>
75+
</include>
76+
</world>
77+
</sdf>

examples/worlds/spacecraft.sdf

Lines changed: 51 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,51 @@
1+
<?xml version="1.0" ?>
2+
<!--
3+
Spacecraft thruster plugin demo
4+
5+
Send commands to a single thruster:
6+
7+
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
8+
-->
9+
<sdf version="1.6">
10+
<world name="zero_g">
11+
<gravity>0 0 0</gravity>
12+
<physics name="1ms" type="ignored">
13+
<max_step_size>0.001</max_step_size>
14+
<real_time_factor>1.0</real_time_factor>
15+
</physics>
16+
<plugin
17+
filename="gz-sim-physics-system"
18+
name="gz::sim::systems::Physics">
19+
</plugin>
20+
<plugin
21+
filename="gz-sim-scene-broadcaster-system"
22+
name="gz::sim::systems::SceneBroadcaster">
23+
</plugin>
24+
<plugin
25+
filename="gz-sim-user-commands-system"
26+
name="gz::sim::systems::UserCommands">
27+
</plugin>
28+
<plugin
29+
filename="gz-sim-sensors-system"
30+
name="gz::sim::systems::Sensors">
31+
<render_engine>ogre2</render_engine>
32+
</plugin>
33+
<light type="directional" name="sun">
34+
<cast_shadows>true</cast_shadows>
35+
<pose>0 0 10 0 0 0</pose>
36+
<diffuse>0.8 0.8 0.8 1</diffuse>
37+
<specular>0.2 0.2 0.2 1</specular>
38+
<attenuation>
39+
<range>1000</range>
40+
<constant>0.9</constant>
41+
<linear>0.01</linear>
42+
<quadratic>0.001</quadratic>
43+
</attenuation>
44+
<direction>-0.5 0.1 -0.9</direction>
45+
</light>
46+
<include>
47+
<pose>0 0 0 0 0 0</pose>
48+
<uri>https://fuel.gazebosim.org/1.0/proque/models/dart/7</uri>
49+
</include>
50+
</world>
51+
</sdf>

src/systems/CMakeLists.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -152,6 +152,7 @@ add_subdirectory(rf_comms)
152152
add_subdirectory(scene_broadcaster)
153153
add_subdirectory(sensors)
154154
add_subdirectory(shader_param)
155+
add_subdirectory(spacecraft_thruster_model)
155156
add_subdirectory(thermal)
156157
add_subdirectory(thruster)
157158
add_subdirectory(touch_plugin)
Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
gz_add_system(spacecraft-thruster-model
2+
SOURCES
3+
SpacecraftThrusterModel.cc
4+
PUBLIC_LINK_LIBS
5+
gz-common${GZ_COMMON_VER}::gz-common${GZ_COMMON_VER}
6+
)

0 commit comments

Comments
 (0)