Skip to content

Commit 9334ab0

Browse files
Merge pull request grvcTeam#4 from grvcTeam/master
changes in mavros
2 parents fad0ea6 + 4e226f3 commit 9334ab0

File tree

21 files changed

+363
-167
lines changed

21 files changed

+363
-167
lines changed

px4_bringup/launch/spawn_robot.launch

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,7 @@ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLI
2323
<arg name="y" default="0"/>
2424
<arg name="z" default="0"/>
2525
<arg name="yaw" default="0"/>
26+
<arg name="rtcm_topic" default=""/>
2627

2728
<group if="$(eval mode == 'sitl')">
2829
<!-- Spawn model in Gazebo -->
@@ -37,11 +38,11 @@ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLI
3738
<!-- Run safety pilot simulator -->
3839
<!-- WARNING: Run only in simulation! -->
3940
<node pkg="ual_teleop" type="simulate_safety_pilot.py" name="safety_pilot" output="screen"
40-
args="-id=$(arg id) -joy_file=$(find ual_teleop)/config/saitek_p3200.yaml"/>
41+
args="-id=$(arg id) -joy_name=saitek_p3200"/>
4142
</group>
4243

4344
<!-- Run mavros node -->
4445
<node pkg="px4_bringup" type="run_mavros.py" name="run_mavros_$(arg id)" output="screen"
45-
args="-id=$(arg id) -mode=$(arg mode) -target_ip=$(arg target_ip) -own_ip=$(arg own_ip) -fcu_url=$(arg fcu_url) -gcs_url=$(arg gcs_url)" />
46+
args="-id=$(arg id) -mode=$(arg mode) -target_ip=$(arg target_ip) -own_ip=$(arg own_ip) -fcu_url=$(arg fcu_url) -gcs_url=$(arg gcs_url) -rtcm_topic=$(arg rtcm_topic)" />
4647

4748
</launch>

px4_bringup/launch/test_simulate.launch

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLI
2121
</node>
2222

2323
<!-- Launch robot id=1 -->
24-
<include file="$(find px4_bringup)/launch/spawn_robot.launch" ns="uav_1">
24+
<include file="$(find px4_bringup)/launch/spawn_robot.launch" unless="$(arg multi)">
2525
<arg name="id" value="1"/>
2626
<arg name="material" value="Orange"/>
2727
<arg name="x" default="0"/>
@@ -31,6 +31,15 @@ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLI
3131
</include>
3232

3333
<group if="$(arg multi)">
34+
<!-- Launch robot id=1 -->
35+
<include file="$(find px4_bringup)/launch/spawn_robot.launch" ns="uav_1">
36+
<arg name="id" value="1"/>
37+
<arg name="material" value="Orange"/>
38+
<arg name="x" default="0"/>
39+
<arg name="y" default="0"/>
40+
<arg name="z" default="0"/>
41+
<arg name="yaw" default="0"/>
42+
</include>
3443
<!-- Launch robot id=2 -->
3544
<include file="$(find px4_bringup)/launch/spawn_robot.launch" ns="uav_2">
3645
<arg name="id" value="2"/>

px4_bringup/scripts/run_mavros.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,8 @@ def main():
2222
help='set fcu_url manually in custom mode')
2323
parser.add_argument('-gcs_url', type=str, default="",
2424
help='set gcs_url manually in custom mode')
25+
parser.add_argument('-rtcm_topic', type=str, default="",
26+
help='set topic for gps rtk corrections')
2527
args, unknown = parser.parse_known_args()
2628
utils.check_unknown_args(unknown)
2729

@@ -72,6 +74,8 @@ def main():
7274

7375
# Finally rosrun mavros
7476
rosrun_args = "rosrun mavros mavros_node __name:=" + "mavros" + " __ns:=" + ns
77+
if args.rtcm_topic:
78+
rosrun_args = rosrun_args + " mavros/gps_rtk/send_rtcm:=" + args.rtcm_topic
7579
rosrun_out = open(temp_dir+"/mavros.out", 'w')
7680
rosrun_err = open(temp_dir+"/mavros.err", 'w')
7781
try:

robots_description/models/mbzirc/geometry.xacro

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -82,6 +82,27 @@
8282
<origin xyz="0 0.24 -0.24" rpy="0 1.57 0" />
8383
</xacro:camera_macro>
8484

85+
<!-- Magnetic gripper -->
86+
<link name="magnetic_gripper">
87+
<inertial>
88+
<origin xyz="0 0 0"/>
89+
<mass value="0.015"/>
90+
<inertia ixx="1e-05" ixy="0" ixz="0" iyy="1e-05" iyz="0" izz="1e-05"/>
91+
</inertial>
92+
<visual>
93+
<origin xyz="0 0 0"/>
94+
<geometry>
95+
<cylinder radius="0.01" length="0.01"/>
96+
</geometry>
97+
</visual>
98+
</link>
99+
<joint name="base_to_gripper" type="revolute">
100+
<origin xyz="0 0 -0.2"/>
101+
<parent link="base_link"/>
102+
<child link="magnetic_gripper"/>
103+
<limit effort="0" lower="0" upper="0" velocity="0"/>
104+
</joint>
105+
85106
<!-- Instantiate rotors -->
86107
<xacro:vertical_rotor
87108
robot_namespace="${namespace}"

ual_teleop/config/joy_teleop.yaml

Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
joy_actions:
2+
3+
secure:
4+
id: left_shoulder
5+
6+
take_off:
7+
id: x
8+
9+
land:
10+
id: b
11+
12+
toggle_headless:
13+
id: right_shoulder
14+
15+
speed_down:
16+
id: left_trigger
17+
18+
speed_up:
19+
id: right_trigger
20+
21+
move_up:
22+
id: left_analog_y
23+
reversed: false
24+
25+
move_yaw:
26+
id: left_analog_x
27+
reversed: true
28+
29+
move_forward:
30+
id: right_analog_y
31+
reversed: false
32+
33+
move_right:
34+
id: right_analog_x
35+
reversed: true
Lines changed: 0 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -1,75 +1,57 @@
11
joy_layout:
22
a:
3-
type: button
43
index: 0
54
b:
6-
type: button
75
index: 1
86
x:
9-
type: button
107
index: 3
118
y:
12-
type: button
139
index: 4
1410

1511
left_shoulder:
16-
type: button
1712
index: 6
1813

1914
right_shoulder:
20-
type: button
2115
index: 7
2216

2317
left_trigger:
24-
type: button
2518
index: 8
2619

2720
right_trigger:
28-
type: button
2921
index: 9
3022

3123
select:
32-
type: button
3324
index: 10
3425

3526
start:
36-
type: button
3727
index: 11
3828

3929
left_thumb:
40-
type: button
4130
index: 13
4231

4332
right_thumb:
44-
type: button
4533
index: 14
4634

4735
left_analog_x:
48-
type: axis
4936
index: 0
5037
reversed: true
5138

5239
left_analog_y:
53-
type: axis
5440
index: 1
5541
reversed: false
5642

5743
right_analog_x:
58-
type: axis
5944
index: 2
6045
reversed: true
6146

6247
right_analog_y:
63-
type: axis
6448
index: 3
6549
reversed: false
6650

6751
dpad_x:
68-
type: axis
6952
index: 6
7053
reversed: true
7154

7255
dpad_y:
73-
type: axis
7456
index: 7
7557
reversed: false
Lines changed: 0 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -1,75 +1,57 @@
11
joy_layout:
22
a:
3-
type: button
43
index: 1
54
b:
6-
type: button
75
index: 2
86
x:
9-
type: button
107
index: 0
118
y:
12-
type: button
139
index: 3
1410

1511
left_shoulder:
16-
type: button
1712
index: 4
1813

1914
right_shoulder:
20-
type: button
2115
index: 5
2216

2317
left_trigger:
24-
type: button
2518
index: 6
2619

2720
right_trigger:
28-
type: button
2921
index: 7
3022

3123
select:
32-
type: button
3324
index: 8
3425

3526
start:
36-
type: button
3727
index: 9
3828

3929
left_thumb:
40-
type: button
4130
index: 10
4231

4332
right_thumb:
44-
type: button
4533
index: 11
4634

4735
left_analog_x:
48-
type: axis
4936
index: 0
5037
reversed: true
5138

5239
left_analog_y:
53-
type: axis
5440
index: 1
5541
reversed: false
5642

5743
right_analog_x:
58-
type: axis
5944
index: 5
6045
reversed: true
6146

6247
right_analog_y:
63-
type: axis
6448
index: 2
6549
reversed: false
6650

6751
dpad_x:
68-
type: axis
6952
index: 5
7053
reversed: true
7154

7255
dpad_y:
73-
type: axis
7456
index: 6
7557
reversed: false
Lines changed: 0 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -1,75 +1,57 @@
11
joy_layout:
22
a:
3-
type: button
43
index: 2
54
b:
6-
type: button
75
index: 1
86
x:
9-
type: button
107
index: 3
118
y:
12-
type: button
139
index: 0
1410

1511
left_shoulder:
16-
type: button
1712
index: 4
1813

1914
right_shoulder:
20-
type: button
2115
index: 5
2216

2317
left_trigger:
24-
type: button
2518
index: 6
2619

2720
right_trigger:
28-
type: button
2921
index: 7
3022

3123
select:
32-
type: button
3324
index: 8
3425

3526
start:
36-
type: button
3727
index: 9
3828

3929
left_thumb:
40-
type: button
4130
index: 10
4231

4332
right_thumb:
44-
type: button
4533
index: 11
4634

4735
left_analog_x:
48-
type: axis
4936
index: 0
5037
reversed: true
5138

5239
left_analog_y:
53-
type: axis
5440
index: 1
5541
reversed: false
5642

5743
right_analog_x:
58-
type: axis
5944
index: 3
6045
reversed: true
6146

6247
right_analog_y:
63-
type: axis
6448
index: 4
6549
reversed: false
6650

6751
dpad_x:
68-
type: axis
6952
index: 5
7053
reversed: true
7154

7255
dpad_y:
73-
type: axis
7456
index: 6
7557
reversed: false

0 commit comments

Comments
 (0)