Skip to content

Commit

Permalink
Merge pull request grvcTeam#4 from grvcTeam/master
Browse files Browse the repository at this point in the history
changes in mavros
  • Loading branch information
AlejandroCastillejo authored Mar 22, 2019
2 parents fad0ea6 + 4e226f3 commit 9334ab0
Show file tree
Hide file tree
Showing 21 changed files with 363 additions and 167 deletions.
5 changes: 3 additions & 2 deletions px4_bringup/launch/spawn_robot.launch
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLI
<arg name="y" default="0"/>
<arg name="z" default="0"/>
<arg name="yaw" default="0"/>
<arg name="rtcm_topic" default=""/>

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

<!-- Run mavros node -->
<node pkg="px4_bringup" type="run_mavros.py" name="run_mavros_$(arg id)" output="screen"
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)" />
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)" />

</launch>
11 changes: 10 additions & 1 deletion px4_bringup/launch/test_simulate.launch
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLI
</node>

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

<group if="$(arg multi)">
<!-- Launch robot id=1 -->
<include file="$(find px4_bringup)/launch/spawn_robot.launch" ns="uav_1">
<arg name="id" value="1"/>
<arg name="material" value="Orange"/>
<arg name="x" default="0"/>
<arg name="y" default="0"/>
<arg name="z" default="0"/>
<arg name="yaw" default="0"/>
</include>
<!-- Launch robot id=2 -->
<include file="$(find px4_bringup)/launch/spawn_robot.launch" ns="uav_2">
<arg name="id" value="2"/>
Expand Down
4 changes: 4 additions & 0 deletions px4_bringup/scripts/run_mavros.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,8 @@ def main():
help='set fcu_url manually in custom mode')
parser.add_argument('-gcs_url', type=str, default="",
help='set gcs_url manually in custom mode')
parser.add_argument('-rtcm_topic', type=str, default="",
help='set topic for gps rtk corrections')
args, unknown = parser.parse_known_args()
utils.check_unknown_args(unknown)

Expand Down Expand Up @@ -72,6 +74,8 @@ def main():

# Finally rosrun mavros
rosrun_args = "rosrun mavros mavros_node __name:=" + "mavros" + " __ns:=" + ns
if args.rtcm_topic:
rosrun_args = rosrun_args + " mavros/gps_rtk/send_rtcm:=" + args.rtcm_topic
rosrun_out = open(temp_dir+"/mavros.out", 'w')
rosrun_err = open(temp_dir+"/mavros.err", 'w')
try:
Expand Down
21 changes: 21 additions & 0 deletions robots_description/models/mbzirc/geometry.xacro
Original file line number Diff line number Diff line change
Expand Up @@ -82,6 +82,27 @@
<origin xyz="0 0.24 -0.24" rpy="0 1.57 0" />
</xacro:camera_macro>

<!-- Magnetic gripper -->
<link name="magnetic_gripper">
<inertial>
<origin xyz="0 0 0"/>
<mass value="0.015"/>
<inertia ixx="1e-05" ixy="0" ixz="0" iyy="1e-05" iyz="0" izz="1e-05"/>
</inertial>
<visual>
<origin xyz="0 0 0"/>
<geometry>
<cylinder radius="0.01" length="0.01"/>
</geometry>
</visual>
</link>
<joint name="base_to_gripper" type="revolute">
<origin xyz="0 0 -0.2"/>
<parent link="base_link"/>
<child link="magnetic_gripper"/>
<limit effort="0" lower="0" upper="0" velocity="0"/>
</joint>

<!-- Instantiate rotors -->
<xacro:vertical_rotor
robot_namespace="${namespace}"
Expand Down
35 changes: 35 additions & 0 deletions ual_teleop/config/joy_teleop.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
joy_actions:

secure:
id: left_shoulder

take_off:
id: x

land:
id: b

toggle_headless:
id: right_shoulder

speed_down:
id: left_trigger

speed_up:
id: right_trigger

move_up:
id: left_analog_y
reversed: false

move_yaw:
id: left_analog_x
reversed: true

move_forward:
id: right_analog_y
reversed: false

move_right:
id: right_analog_x
reversed: true
Original file line number Diff line number Diff line change
@@ -1,75 +1,57 @@
joy_layout:
a:
type: button
index: 0
b:
type: button
index: 1
x:
type: button
index: 3
y:
type: button
index: 4

left_shoulder:
type: button
index: 6

right_shoulder:
type: button
index: 7

left_trigger:
type: button
index: 8

right_trigger:
type: button
index: 9

select:
type: button
index: 10

start:
type: button
index: 11

left_thumb:
type: button
index: 13

right_thumb:
type: button
index: 14

left_analog_x:
type: axis
index: 0
reversed: true

left_analog_y:
type: axis
index: 1
reversed: false

right_analog_x:
type: axis
index: 2
reversed: true

right_analog_y:
type: axis
index: 3
reversed: false

dpad_x:
type: axis
index: 6
reversed: true

dpad_y:
type: axis
index: 7
reversed: false
Original file line number Diff line number Diff line change
@@ -1,75 +1,57 @@
joy_layout:
a:
type: button
index: 1
b:
type: button
index: 2
x:
type: button
index: 0
y:
type: button
index: 3

left_shoulder:
type: button
index: 4

right_shoulder:
type: button
index: 5

left_trigger:
type: button
index: 6

right_trigger:
type: button
index: 7

select:
type: button
index: 8

start:
type: button
index: 9

left_thumb:
type: button
index: 10

right_thumb:
type: button
index: 11

left_analog_x:
type: axis
index: 0
reversed: true

left_analog_y:
type: axis
index: 1
reversed: false

right_analog_x:
type: axis
index: 5
reversed: true

right_analog_y:
type: axis
index: 2
reversed: false

dpad_x:
type: axis
index: 5
reversed: true

dpad_y:
type: axis
index: 6
reversed: false
Original file line number Diff line number Diff line change
@@ -1,75 +1,57 @@
joy_layout:
a:
type: button
index: 2
b:
type: button
index: 1
x:
type: button
index: 3
y:
type: button
index: 0

left_shoulder:
type: button
index: 4

right_shoulder:
type: button
index: 5

left_trigger:
type: button
index: 6

right_trigger:
type: button
index: 7

select:
type: button
index: 8

start:
type: button
index: 9

left_thumb:
type: button
index: 10

right_thumb:
type: button
index: 11

left_analog_x:
type: axis
index: 0
reversed: true

left_analog_y:
type: axis
index: 1
reversed: false

right_analog_x:
type: axis
index: 3
reversed: true

right_analog_y:
type: axis
index: 4
reversed: false

dpad_x:
type: axis
index: 5
reversed: true

dpad_y:
type: axis
index: 6
reversed: false
Loading

0 comments on commit 9334ab0

Please sign in to comment.