Skip to content

Commit

Permalink
updated examples
Browse files Browse the repository at this point in the history
  • Loading branch information
klaxalk committed Nov 13, 2023
1 parent e5a778d commit 79ec411
Show file tree
Hide file tree
Showing 20 changed files with 1,611 additions and 17 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ mrs_uav_managers:
"gps_baro",
]

initial_state_estimator: "gps_baro" # will be used as the first state estimator
initial_state_estimator: "gps_garmin" # will be used as the first state estimator
agl_height_estimator: "garmin_agl" # only slightly filtered height for checking min height (not used in control feedback)

uav_manager:
Expand All @@ -20,6 +20,6 @@ mrs_uav_managers:
tracker: "LandoffTracker"

after_takeoff:
controller: "MpcController"
# controller: "Se3Controller"
controller: "MpcController" # more robust
# controller: "Se3Controller" # more precise
tracker: "MpcTracker"
Original file line number Diff line number Diff line change
Expand Up @@ -16,15 +16,12 @@ windows:
layout: tiled
panes:
- waitForRos; roslaunch mrs_uav_gazebo_simulation simulation.launch world_name:=grass_plane gui:=true
- waitForGazebo; rosservice call /mrs_drone_spawner/spawn "1 $UAV_TYPE --enable-rangefinder"
- waitForControl; gz camera -c gzclient_camera -f $UAV_NAME; history -s gz camera -c gzclient_camera -f $UAV_NAME
- status:
layout: tiled
panes:
- waitForHw; roslaunch mrs_uav_status status.launch
- spawn:
layout: tiled
panes:
- waitForGazebo; rosservice call /mrs_drone_spawner/spawn "1 $UAV_TYPE --enable-rangefinder --enable-ground-truth"
- hw_api:
layout: tiled
panes:
Expand All @@ -51,7 +48,7 @@ windows:
panes:
- waitForControl; roslaunch mrs_uav_core rviz.launch
- waitForControl; roslaunch mrs_rviz_plugins load_robot.launch
- waitForTime; waitForControl; roslaunch mrs_rviz_plugins rviz_interface.launch
- waitForControl; roslaunch mrs_rviz_plugins rviz_interface.launch
- layout:
layout: tiled
panes:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,10 +6,9 @@ mrs_uav_managers:
state_estimators: [
"gps_garmin",
"gps_baro",
"ground_truth",
]

initial_state_estimator: "gps_baro" # will be used as the first state estimator
initial_state_estimator: "gps_garmin" # will be used as the first state estimator
agl_height_estimator: "garmin_agl" # only slightly filtered height for checking min height (not used in control feedback)

uav_manager:
Expand All @@ -21,6 +20,6 @@ mrs_uav_managers:
tracker: "LandoffTracker"

after_takeoff:
controller: "MpcController"
# controller: "Se3Controller"
controller: "MpcController" # more robust
# controller: "Se3Controller" # more precise
tracker: "MpcTracker"
Original file line number Diff line number Diff line change
Expand Up @@ -16,15 +16,12 @@ windows:
layout: tiled
panes:
- waitForRos; roslaunch mrs_uav_gazebo_simulation simulation.launch world_name:=forest gui:=true
- waitForGazebo; rosservice call /mrs_drone_spawner/spawn "1 $UAV_TYPE --enable-rangefinder --enable-ouster --ouster-model OS0-128 --use-gpu-ray --horizontal-samples 128 --rotation-freq 10"
- waitForControl; gz camera -c gzclient_camera -f $UAV_NAME; history -s gz camera -c gzclient_camera -f $UAV_NAME
- status:
layout: tiled
panes:
- waitForHw; roslaunch mrs_uav_status status.launch
- spawn:
layout: tiled
panes:
- waitForGazebo; rosservice call /mrs_drone_spawner/spawn "1 $UAV_TYPE --enable-rangefinder --enable-ground-truth --enable-ouster --ouster-model OS0-128 --use-gpu-ray --horizontal-samples 128 --rotation-freq 10"
- hw_api:
layout: tiled
panes:
Expand All @@ -51,7 +48,7 @@ windows:
panes:
- waitForControl; roslaunch mrs_uav_core rviz.launch
- waitForControl; roslaunch mrs_rviz_plugins load_robot.launch
- waitForTime; waitForControl; roslaunch mrs_rviz_plugins rviz_interface.launch
- waitForControl; roslaunch mrs_rviz_plugins rviz_interface.launch
- layout:
layout: tiled
panes:
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
mrs_uav_managers:

estimation_manager:

# loaded state estimator plugins
state_estimators: [
"gps_garmin",
"gps_baro",
]

initial_state_estimator: "gps_garmin" # will be used as the first state estimator
agl_height_estimator: "garmin_agl" # only slightly filtered height for checking min height (not used in control feedback)

uav_manager:

takeoff:

during_takeoff:
controller: "MpcController"
tracker: "LandoffTracker"

after_takeoff:
controller: "MpcController" # more robust
# controller: "Se3Controller" # more precise
tracker: "MpcTracker"
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
# 1. This list is used by NimbroNetwork for mutual communication of the UAVs
# The names of the robots have to match hostnames described in /etc/hosts.
#
# 2. This list is used by MpcTracker for mutual collision avoidance of the UAVs.
# The names should match the true "UAV_NAMES" (the topic prefixes).
#
# network_config:=~/config/network_config.yaml
#
# to the core.launch and nimbro.launch.

network:

robot_names: [
uav1,
]
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
world_origin:

units: "LATLON" # {"UTM, "LATLON"}

origin_x: 47.397743
origin_y: 8.545594

safety_area:

enabled: true

horizontal:

# the frame of reference in which the points are expressed
frame_name: "world_origin"

# polygon
#
# x, y [m] for any frame_name except latlon_origin
# x = latitude, y = longitude [deg] for frame_name=="latlon_origin"
points: [
-50, -50,
50, -50,
50, 50,
-50, 50,
]

vertical:

# the frame of reference in which the max&min z is expressed
frame_name: "world_origin"

max_z: 15.0
min_z: 0.5
14 changes: 14 additions & 0 deletions ros_packages/mrs_uav_gazebo_simulation/tmux/one_drone_vio/kill.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
#!/bin/bash

# Absolute path to this script. /home/user/bin/foo.sh
SCRIPT=$(readlink -f $0)
# Absolute path this script is in. /home/user/bin
SCRIPTPATH=`dirname $SCRIPT`
cd "$SCRIPTPATH"

export TMUX_SESSION_NAME=simulation
export TMUX_SOCKET_NAME=mrs

# just attach to the session
tmux -L $TMUX_SOCKET_NAME split-window -t $TMUX_SESSION_NAME
tmux -L $TMUX_SOCKET_NAME send-keys -t $TMUX_SESSION_NAME "sleep 1; tmux list-panes -s -F \"#{pane_pid} #{pane_current_command}\" | grep -v tmux | cut -d\" \" -f1 | while read in; do killp \$in; done; exit" ENTER
115 changes: 115 additions & 0 deletions ros_packages/mrs_uav_gazebo_simulation/tmux/one_drone_vio/layout.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,115 @@
[
{
"border": "normal",
"floating": "auto_off",
"fullscreen_mode": 0,
"layout": "splith",
"percent": 0.25,
"type": "con",
"nodes": [
{
"border": "normal",
"floating": "auto_off",
"layout": "splith",
"percent": 1,
"type": "con",
"nodes": [
{
"border": "normal",
"floating": "auto_off",
"layout": "splitv",
"percent": 0.5,
"type": "con",
"nodes": [
{
"border": "pixel",
"current_border_width": 3,
"floating": "auto_off",
"geometry": {
"height": 460,
"width": 724,
"x": 0,
"y": 0
},
"name": "Gazebo",
"percent": 0.5,
"swallows": [
{
"instance": "^gazebo$"
}
],
"type": "con"
},
{
"border": "pixel",
"current_border_width": 3,
"floating": "auto_off",
"geometry": {
"height": 460,
"width": 724,
"x": 0,
"y": 0
},
"name": "rqt_image_view__ImageView - rqt",
"percent": 0.5,
"swallows": [
{
"instance": "^rqt_image_view$"
}
],
"type": "con"
}
]
},
{
"border": "normal",
"floating": "auto_off",
"layout": "splitv",
"percent": 0.5,
"type": "con",
"nodes": [
{
"border": "pixel",
"current_border_width": 3,
"floating": "auto_off",
"geometry": {
"height": 460,
"width": 724,
"x": 0,
"y": 0
},
"name": "default.rviz* - RViz",
"percent": 0.5,
"swallows": [
{
"instance": "^rviz$"
}
],
"type": "con"
},
{
"border": "pixel",
"current_border_width": 3,
"floating": "auto_off",
"geometry": {
"height": 460,
"width": 724,
"x": 0,
"y": 0
},
"name": "runVim session.yml",
"percent": 0.5,
"swallows": [
{
"instance": "^urxvt$"
}
],
"type": "con"
}
]
}
]
}
]
}
]
Original file line number Diff line number Diff line change
@@ -0,0 +1,60 @@
# do not modify these
root: ./
name: simulation
socket_name: mrs
attach: false
tmux_options: -f /etc/ctu-mrs/tmux.conf
# you can modify these
pre_window: export UAV_NAME=uav1; export RUN_TYPE=simulation; export UAV_TYPE=f330
startup_window: status
windows:
- roscore:
layout: tiled
panes:
- roscore
- gazebo:
layout: tiled
panes:
- waitForRos; roslaunch mrs_uav_gazebo_simulation simulation.launch world_name:=mrs_city gui:=true
- waitForGazebo; rosservice call /mrs_drone_spawner/spawn "1 $UAV_TYPE --enable-rangefinder --enable-vio"
- waitForControl; gz camera -c gzclient_camera -f $UAV_NAME; history -s gz camera -c gzclient_camera -f $UAV_NAME
- status:
layout: tiled
panes:
- waitForHw; roslaunch mrs_uav_status status.launch
- vio_data:
layout: tiled
panes:
- waitForHw; rostopic echo /$UAV_NAME/vio/imu
- waitForHw; rosrun rqt_image_view rqt_image_view /$UAV_NAME/vio/camera/image_raw
- hw_api:
layout: tiled
panes:
- waitForTime; roslaunch mrs_uav_px4_api api.launch
- core:
layout: tiled
panes:
- waitForHw; roslaunch mrs_uav_core core.launch
platform_config:=`rospack find mrs_uav_gazebo_simulation`/config/mrs_uav_system/$UAV_TYPE.yaml
custom_config:=./config/custom_config.yaml
world_config:=./config/world_config.yaml
network_config:=./config/network_config.yaml
- takeoff:
layout: tiled
panes:
- waitForHw; roslaunch mrs_uav_autostart automatic_start.launch
- 'waitForControl; rosservice call /$UAV_NAME/hw_api/arming 1; sleep 2; rosservice call /$UAV_NAME/hw_api/offboard'
- goto:
layout: tiled
panes:
- 'history -s rosservice call /$UAV_NAME/control_manager/goto \"goal: \[0.0, 10.0, 1.5, 0.0\]\"'
- rviz:
layout: tiled
panes:
- waitForControl; roslaunch mrs_uav_core rviz.launch
- waitForControl; roslaunch mrs_rviz_plugins load_robot.launch
- waitForControl; roslaunch mrs_rviz_plugins rviz_interface.launch
- layout:
layout: tiled
panes:
- waitForControl; sleep 3; ~/.i3/layout_manager.sh ./layout.json
27 changes: 27 additions & 0 deletions ros_packages/mrs_uav_gazebo_simulation/tmux/one_drone_vio/start.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
#!/bin/bash

# Absolute path to this script. /home/user/bin/foo.sh
SCRIPT=$(readlink -f $0)
# Absolute path this script is in. /home/user/bin
SCRIPTPATH=`dirname $SCRIPT`
cd "$SCRIPTPATH"

export TMUX_SESSION_NAME=simulation
export TMUX_SOCKET_NAME=mrs

# start tmuxinator
tmuxinator start -p ./session.yml

# if we are not in tmux
if [ -z $TMUX ]; then

# just attach to the session
tmux -L $TMUX_SOCKET_NAME a -t $TMUX_SESSION_NAME

# if we are in tmux
else

# switch to the newly-started session
tmux detach-client -E "tmux -L $TMUX_SOCKET_NAME a -t $TMUX_SESSION_NAME"

fi
Loading

0 comments on commit 79ec411

Please sign in to comment.