Skip to content

Commit

Permalink
Gazebo: correct Gazebo ENU to ArduPilot NED transform
Browse files Browse the repository at this point in the history
- Correct orientation and transform for truck - quadplane landing examples.

Signed-off-by: Rhys Mainwaring <rhys.mainwaring@me.com>
  • Loading branch information
srmainwaring committed Jan 11, 2024
1 parent 07df90c commit cfaec90
Show file tree
Hide file tree
Showing 9 changed files with 19 additions and 36 deletions.
14 changes: 2 additions & 12 deletions Gazebo/models/alti_transition_quad/model.sdf
Original file line number Diff line number Diff line change
Expand Up @@ -1122,18 +1122,8 @@
<connectionTimeoutMaxCount>5</connectionTimeoutMaxCount>
<lock_step>1</lock_step>

<!-- Frame conventions
modelXYZToAirplaneXForwardZDown:
- transforms body frame from orientation in Gazebo to NED
gazeboXYZToNED
- transforms world from Gazebo convention xyz = N -E -D
to ArduPilot convention xyz = NED
VTOL is oriented x-forward, y-left, z-up
-->
<modelXYZToAirplaneXForwardZDown>0 0 0 3.141593 0 0</modelXYZToAirplaneXForwardZDown>
<gazeboXYZToNED>0 0 0 3.141593 0 0</gazeboXYZToNED>
<modelXYZToAirplaneXForwardZDown degrees="true">0 0 0 180 0 0</modelXYZToAirplaneXForwardZDown>
<gazeboXYZToNED degrees="true">0 0 0 180 0 90</gazeboXYZToNED>

<!-- Sensors -->
<imuName>imu_sensor</imuName>
Expand Down
14 changes: 2 additions & 12 deletions Gazebo/models/alti_transition_quad/model.sdf.erb
Original file line number Diff line number Diff line change
Expand Up @@ -1143,18 +1143,8 @@ DO NOT EDIT. This file is generated from an ERB template.
<connectionTimeoutMaxCount>5</connectionTimeoutMaxCount>
<lock_step>1</lock_step>

<!-- Frame conventions
modelXYZToAirplaneXForwardZDown:
- transforms body frame from orientation in Gazebo to NED
gazeboXYZToNED
- transforms world from Gazebo convention xyz = N -E -D
to ArduPilot convention xyz = NED
VTOL is oriented x-forward, y-left, z-up
-->
<modelXYZToAirplaneXForwardZDown>0 0 0 3.141593 0 0</modelXYZToAirplaneXForwardZDown>
<gazeboXYZToNED>0 0 0 3.141593 0 0</gazeboXYZToNED>
<modelXYZToAirplaneXForwardZDown degrees="true">0 0 0 180 0 0</modelXYZToAirplaneXForwardZDown>
<gazeboXYZToNED degrees="true">0 0 0 180 0 90</gazeboXYZToNED>

<!-- Sensors -->
<imuName>imu_sensor</imuName>
Expand Down
4 changes: 2 additions & 2 deletions Gazebo/models/daf_xf_450_flatbed_trailer/model.sdf
Original file line number Diff line number Diff line change
Expand Up @@ -602,8 +602,8 @@
<fdm_addr>127.0.0.1</fdm_addr>
<fdm_port_in>9012</fdm_port_in>
<connectionTimeoutMaxCount>5</connectionTimeoutMaxCount>
<modelXYZToAirplaneXForwardZDown>0 0 0 3.141593 0 0</modelXYZToAirplaneXForwardZDown>
<gazeboXYZToNED>0 0 0 3.141593 0 0</gazeboXYZToNED>
<modelXYZToAirplaneXForwardZDown degrees="true">0 0 0 180 0 0</modelXYZToAirplaneXForwardZDown>
<gazeboXYZToNED degrees="true">0 0 0 180 0 90</gazeboXYZToNED>
<imuName>imu_sensor</imuName>
</plugin>

Expand Down
4 changes: 2 additions & 2 deletions Gazebo/models/daf_xf_450_flatbed_trailer/model.sdf.erb
Original file line number Diff line number Diff line change
Expand Up @@ -625,8 +625,8 @@ DO NOT EDIT. This file is generated from an ERB template.
<fdm_addr><%= fdm_addr %></fdm_addr>
<fdm_port_in><%= fdm_port_in %></fdm_port_in>
<connectionTimeoutMaxCount>5</connectionTimeoutMaxCount>
<modelXYZToAirplaneXForwardZDown>0 0 0 3.141593 0 0</modelXYZToAirplaneXForwardZDown>
<gazeboXYZToNED>0 0 0 3.141593 0 0</gazeboXYZToNED>
<modelXYZToAirplaneXForwardZDown degrees="true">0 0 0 180 0 0</modelXYZToAirplaneXForwardZDown>
<gazeboXYZToNED degrees="true">0 0 0 180 0 90</gazeboXYZToNED>
<imuName>imu_sensor</imuName>
</plugin>

Expand Down
4 changes: 2 additions & 2 deletions Gazebo/models/daf_xf_450_tractor/model.sdf
Original file line number Diff line number Diff line change
Expand Up @@ -692,8 +692,8 @@
<fdm_addr>127.0.0.1</fdm_addr>
<fdm_port_in>9002</fdm_port_in>
<connectionTimeoutMaxCount>5</connectionTimeoutMaxCount>
<modelXYZToAirplaneXForwardZDown>0 0 0 3.141593 0 0</modelXYZToAirplaneXForwardZDown>
<gazeboXYZToNED>0 0 0 3.141593 0 0</gazeboXYZToNED>
<modelXYZToAirplaneXForwardZDown degrees="true">0 0 0 180 0 0</modelXYZToAirplaneXForwardZDown>
<gazeboXYZToNED degrees="true">0 0 0 180 0 90</gazeboXYZToNED>

<!-- Sensors -->
<!-- <imuName>imu_link::imu_sensor</imuName> -->
Expand Down
4 changes: 2 additions & 2 deletions Gazebo/models/daf_xf_450_tractor/model.sdf.erb
Original file line number Diff line number Diff line change
Expand Up @@ -722,8 +722,8 @@ DO NOT EDIT. This file is generated from an ERB template.
<fdm_addr><%= fdm_addr %></fdm_addr>
<fdm_port_in><%= fdm_port_in %></fdm_port_in>
<connectionTimeoutMaxCount>5</connectionTimeoutMaxCount>
<modelXYZToAirplaneXForwardZDown>0 0 0 3.141593 0 0</modelXYZToAirplaneXForwardZDown>
<gazeboXYZToNED>0 0 0 3.141593 0 0</gazeboXYZToNED>
<modelXYZToAirplaneXForwardZDown degrees="true">0 0 0 180 0 0</modelXYZToAirplaneXForwardZDown>
<gazeboXYZToNED degrees="true">0 0 0 180 0 90</gazeboXYZToNED>

<!-- Sensors -->
<!-- <imuName>imu_link::imu_sensor</imuName> -->
Expand Down
3 changes: 2 additions & 1 deletion Gazebo/worlds/alti_transition_runway.sdf
Original file line number Diff line number Diff line change
Expand Up @@ -35,11 +35,12 @@
</light>

<include>
<pose degrees="true">-29 545 0 0 0 363</pose>
<uri>model://runway</uri>
</include>

<include>
<pose>0 0 0.35 0 0 0</pose>
<pose degrees="true">0 0 0.35 0 0 90</pose>
<uri>model://alti_transition_quad</uri>
</include>

Expand Down
3 changes: 2 additions & 1 deletion Gazebo/worlds/daf_truck_runway.sdf
Original file line number Diff line number Diff line change
Expand Up @@ -35,11 +35,12 @@
</light>

<include>
<pose degrees="true">-29 545 0 0 0 363</pose>
<uri>model://runway</uri>
</include>

<include>
<pose>0 0 1.0 0 0 0</pose>
<pose degrees="true">0 0 1.0 0 0 90</pose>
<uri>model://daf_xf_450_tractor</uri>
</include>

Expand Down
5 changes: 3 additions & 2 deletions Gazebo/worlds/truck_quadplane_landing.sdf.erb
Original file line number Diff line number Diff line change
Expand Up @@ -29,12 +29,12 @@
trailer_model = make_trailer_model('trailer', trailer_pose, 9012)

# make the tractor model and inject trailer
tractor_pose = '0 0 1.0 0 0 0'
tractor_pose = '0 0 1.0 0 0 1.57079632'
tractor_model = make_tractor_model('tractor', tractor_pose, 9002,
trailer_joint, trailer_model)

# make the quadplane and place on the trailer
quadplane_pose = '-8.0 0 1.6 0 0 0'
quadplane_pose = '0 -8.0 1.6 0 0 1.57079632'
quadplane_model = make_quadplane_model('quadplane', quadplane_pose, 9022)
%>

Expand Down Expand Up @@ -75,6 +75,7 @@
</light>

<include>
<pose degrees="true">-29 545 0 0 0 363</pose>
<uri>model://runway</uri>
</include>

Expand Down

0 comments on commit cfaec90

Please sign in to comment.