Skip to content

Commit 6470c4a

Browse files
Merge pull request #28 from grvcTeam/ual2.0
UAL 2.0
2 parents 96fbee5 + b2884af commit 6470c4a

33 files changed

+388
-672
lines changed

README.md

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,8 @@
11
# grvc-ual
2+
[![Releases](https://img.shields.io/github/release/grvcTeam/grvc-ual.svg)](https://github.com/grvcTeam/grvc-ual/releases)
23

34
A repository for the GRVC UAV abstraction layer.
45

5-
Master branch should always be last stable version of this software. As packages in this repo are heavily dependent on packages in [grvc-utils](https://github.com/grvcTeam/grvc-utils) and our feelings about git submodules are not clear, make sure you have both repositories updated.
6-
76
## Installation and use
87

98
Download the latest stable version from [here](https://github.com/grvcTeam/grvc-ual/releases).
@@ -12,5 +11,4 @@ You can find the instructions for installation and how to use the UAL in the [Wi
1211

1312
## Dependencies
1413

15-
* [grvc-utils](https://github.com/grvcTeam/grvc-utils)
16-
* [PX4 Firmware](https://github.com/PX4/Firmware) at tag [v1.6.3](https://github.com/PX4/Firmware/tree/v1.6.3)
14+
* [PX4 Firmware](https://github.com/PX4/Firmware) at tag [v1.7.3](https://github.com/PX4/Firmware/tree/v1.7.3)

px4_bringup/config/simulation_params.yaml

Lines changed: 1 addition & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,6 @@
11
#--------------------------------------------------------------------------------------------#
2-
# Gazebo origin (lat-lon-alt) can be defined with 'map_frame' or with 'sim_origin' params
2+
# Gazebo origin (lat-lon-alt) can be defined with 'sim_origin' param
33
#--------------------------------------------------------------------------------------------#
4-
# map frame (if we need a map to world transform)
5-
# map_frame:
6-
# frame_id: "map"
7-
# parent_frame: "world"
8-
# units: "GPS"
9-
# translation: [37.558542, -5.931074, 7.89]
10-
# rotation: [0.0, 0.0, 0.0] # RPY
11-
12-
# sim_origin (if we only want to define Gazebo origin)
134
sim_origin: [37.558542, -5.931074, 7.89]
145

156
#--------------------------------------------------------------------------------------------#

px4_bringup/launch/test_simulate.launch

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -15,9 +15,6 @@ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLI
1515
<!-- Load frame transforms for map and UAVs -->
1616
<rosparam file="$(find px4_bringup)/config/simulation_params.yaml" command="load" />
1717

18-
<!-- Launch static_tf_publisher for map to world transform (if defined) -->
19-
<node pkg="static_tf_publisher" type="static_tf_publisher_node" name="static_tf_publisher"/>
20-
2118
<!-- Launch Gazebo simulation TODO: world location? -->
2219
<node pkg="px4_bringup" type="launch_gzworld.py" name="gazebo_world" output="screen"
2320
args="-physics=ode -world=$(find px4_bringup)/config/empty_light.world"/>

px4_bringup/package.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
<?xml version="1.0"?>
22
<package>
33
<name>px4_bringup</name>
4-
<version>0.0.1</version>
4+
<version>2.0.0</version>
55
<description>This package brings up the mavros interface of a px4 autopilot,
66
that can be real or simulted in gazebo with software-in-the-loop (sitl).</description>
77

px4_bringup/scripts/launch_gzworld.py

Lines changed: 3 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ def main():
2929
# Set environment variables as in px4/Firmware/Tools/setup_gazebo.bash
3030
gz_env = os.environ.copy()
3131
current_gz_plugin_path = gz_env.get('GAZEBO_PLUGIN_PATH', '')
32-
gz_env['GAZEBO_PLUGIN_PATH'] = px4_dir + '/build_posix_sitl_default/build_gazebo' + \
32+
gz_env['GAZEBO_PLUGIN_PATH'] = px4_dir + '/build/posix_sitl_default/build_gazebo' + \
3333
':' + current_gz_plugin_path
3434
current_gz_model_path = gz_env.get('GAZEBO_MODEL_PATH', '')
3535
description_parent_path = os.path.abspath(os.path.join(\
@@ -42,14 +42,7 @@ def main():
4242
gz_env['GAZEBO_MODEL_PATH'] += ':' + args.add_model_path
4343

4444
# Get map origin lat-lon-alt from rosparam
45-
if rospy.has_param('/map_frame'):
46-
map_frame_dict = rospy.get_param('/map_frame')
47-
if map_frame_dict['units']=='GPS':
48-
latlonalt = map_frame_dict['translation']
49-
else:
50-
#TODO UTM to LAT-LON
51-
pass
52-
elif rospy.has_param('/sim_origin'):
45+
if rospy.has_param('/sim_origin'):
5346
latlonalt = rospy.get_param('/sim_origin')
5447
else:
5548
latlonalt = [0.0, 0.0, 0.0]
@@ -74,6 +67,7 @@ def main():
7467
env=gz_env, shell=True, preexec_fn=os.setsid)
7568

7669
# Start gazebo client
70+
time.sleep(0.2)
7771
client_args = "rosrun gazebo_ros gzclient"
7872
client_out = open(temp_dir + '/gzclient.out', 'w')
7973
client_err = open(temp_dir + '/gzclient.err', 'w')

px4_bringup/scripts/run_px4sitl.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ def main():
4141

4242
# Spawn px4
4343
px4_src = rospack.get_path("px4")
44-
px4_bin = px4_src + "/build_posix_sitl_default/src/firmware/posix/px4"
44+
px4_bin = px4_src + "/build/posix_sitl_default/px4"
4545
px4_args = px4_bin + " " + px4_src + " " + modified_cmds
4646
px4_out = open(temp_dir+"/px4.out", 'w')
4747
px4_err = open(temp_dir+"/px4.err", 'w')

px4_bringup/scripts/spawn_gzmodel.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -63,6 +63,7 @@ def main():
6363
xacro_args = "xacro --inorder -o " + temp_urdf + " " + \
6464
xacro_description + \
6565
" enable_mavlink_interface:=true" + \
66+
" enable_gps_plugin:=true" + \
6667
" enable_ground_truth:=false" + \
6768
" enable_logging:=false" + \
6869
" enable_camera:=false" + \
@@ -97,7 +98,7 @@ def main():
9798
if args.model == 'typhoon_h480':
9899
for plugintag in model.findall('plugin'):
99100
if plugintag.get('name') == 'gimbal_controller':
100-
imutag = plugintag.find('imu')
101+
imutag = plugintag.find('gimbal_imu')
101102
imutag.text = 'typhoon_h480_' + str(args.id) + '::camera_imu'
102103
for linktag in model.findall('link'):
103104
if linktag.get('name') == 'cgo3_camera_link':
@@ -150,7 +151,7 @@ def main():
150151
robot_yaw = 0.0
151152

152153
# Sleep for waiting the world to load
153-
rospy.sleep(0.2)
154+
rospy.sleep(0.4)
154155

155156
# Minimum z to avoid collision with ground
156157
z_min = 0.3

robots_description/models/aeroarms/model.xacro

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,8 @@
88
<xacro:arg name='mavlink_udp_port' default='14560' />
99
<xacro:arg name='visual_material' default='DarkGrey' />
1010
<xacro:arg name='enable_mavlink_interface' default='true' />
11+
<xacro:arg name='enable_gps_plugin' default='true' />
12+
<xacro:arg name='gps_noise' default='true' />
1113
<xacro:arg name='enable_ground_truth' default='false' />
1214
<xacro:arg name='enable_logging' default='false' />
1315

@@ -17,6 +19,15 @@
1719
<!-- Instantiate aeroarms "mechanics" -->
1820
<xacro:include filename="$(find robots_description)/models/aeroarms/geometry.xacro" />
1921

22+
<xacro:if value="$(arg enable_gps_plugin)">
23+
<!-- Instantiate gps plugin. -->
24+
<xacro:gps_plugin_macro
25+
namespace="${namespace}"
26+
gps_noise="$(arg gps_noise)"
27+
>
28+
</xacro:gps_plugin_macro>
29+
</xacro:if>
30+
2031
<xacro:if value="$(arg enable_mavlink_interface)">
2132
<!-- Instantiate mavlink telemetry interface. -->
2233
<xacro:mavlink_interface_macro

robots_description/models/aeroarms_pendulum/model.xacro

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,8 @@
88
<xacro:arg name='mavlink_udp_port' default='14560' />
99
<xacro:arg name='visual_material' default='DarkGrey' />
1010
<xacro:arg name='enable_mavlink_interface' default='true' />
11+
<xacro:arg name='enable_gps_plugin' default='true' />
12+
<xacro:arg name='gps_noise' default='true' />
1113
<xacro:arg name='enable_ground_truth' default='false' />
1214
<xacro:arg name='enable_logging' default='false' />
1315

@@ -17,6 +19,15 @@
1719
<!-- Instantiate aeroarms "mechanics" -->
1820
<xacro:include filename="$(find robots_description)/models/aeroarms_pendulum/geometry.xacro" />
1921

22+
<xacro:if value="$(arg enable_gps_plugin)">
23+
<!-- Instantiate gps plugin. -->
24+
<xacro:gps_plugin_macro
25+
namespace="${namespace}"
26+
gps_noise="$(arg gps_noise)"
27+
>
28+
</xacro:gps_plugin_macro>
29+
</xacro:if>
30+
2031
<xacro:if value="$(arg enable_mavlink_interface)">
2132
<!-- Instantiate mavlink telemetry interface. -->
2233
<xacro:mavlink_interface_macro

robots_description/models/iris/model.xacro

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,8 @@
88
<xacro:arg name='mavlink_udp_port' default='14560' />
99
<xacro:arg name='visual_material' default='DarkGrey' />
1010
<xacro:arg name='enable_mavlink_interface' default='true' />
11+
<xacro:arg name='enable_gps_plugin' default='true' />
12+
<xacro:arg name='gps_noise' default='true' />
1113
<xacro:arg name='enable_ground_truth' default='false' />
1214
<xacro:arg name='enable_logging' default='false' />
1315

@@ -17,6 +19,15 @@
1719
<!-- Instantiate iris "mechanics" -->
1820
<xacro:include filename="$(find robots_description)/models/iris/geometry.xacro" />
1921

22+
<xacro:if value="$(arg enable_gps_plugin)">
23+
<!-- Instantiate gps plugin. -->
24+
<xacro:gps_plugin_macro
25+
namespace="${namespace}"
26+
gps_noise="$(arg gps_noise)"
27+
>
28+
</xacro:gps_plugin_macro>
29+
</xacro:if>
30+
2031
<xacro:if value="$(arg enable_mavlink_interface)">
2132
<!-- Instantiate mavlink telemetry interface. -->
2233
<xacro:mavlink_interface_macro

0 commit comments

Comments
 (0)