Skip to content

Commit

Permalink
Merge branch 'IMRCLab/main'
Browse files Browse the repository at this point in the history
  • Loading branch information
ywang760 committed Jul 11, 2024
2 parents 854b1f5 + 7db011d commit 5d9aa42
Show file tree
Hide file tree
Showing 98 changed files with 6,259 additions and 1,248 deletions.
5 changes: 4 additions & 1 deletion .github/workflows/ci-docs2.yml
Original file line number Diff line number Diff line change
@@ -1,8 +1,10 @@
name: Docs deploy
name: Docs

on:
push:
branches: [ main ]
pull_request:
branches: [ main ]

jobs:
build:
Expand Down Expand Up @@ -33,6 +35,7 @@ jobs:
touch docs2/_build/html/.nojekyll
- name: Deploy
if: github.ref == 'refs/heads/main'
uses: JamesIves/github-pages-deploy-action@v4
with:
folder: docs2/_build/html # The folder the action should deploy.
21 changes: 19 additions & 2 deletions .github/workflows/ci-ros2.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ jobs:
ros_distribution:
- humble
- iron
- jazzy

# Define the Docker image(s) associated with each ROS distribution.
include:
Expand All @@ -29,6 +30,11 @@ jobs:
ros_distribution: iron
ros_version: 2

# Jazzy Jalisco (May 2024 - May 2029)
- docker_image: ubuntu:noble
ros_distribution: jazzy
ros_version: 2

container:
image: ${{ matrix.docker_image }}
steps:
Expand All @@ -40,16 +46,27 @@ jobs:
- name: install dependencies
run: |
sudo apt update
sudo apt install -y libusb-1.0-0-dev
sudo apt install -y libboost-program-options-dev libusb-1.0-0-dev
- name: install pip dependencies
# TODO: would be better to follow https://answers.ros.org/question/370666/how-to-declare-an-external-python-dependency-in-ros2/
# but this requires some upstream changes

# colcon still does not seem to properly support venv, so we use a workaround to install
# a python package globally by disabling the externally managed flag that is default on Ubuntu 24.04
run: |
sudo rm -f /usr/lib/python3.12/EXTERNALLY-MANAGED
pip install rowan
- uses: actions/checkout@v2
- name: build and test ROS 2
uses: ros-tooling/[email protected]
with:
# TODO: removed crazyflie_interfaces since it causes some test failures
package-name: |
crazyflie
crazyflie_examples
crazyflie_interfaces
crazyflie_py
crazyflie_sim
target-ros2-distro: ${{ matrix.ros_distribution }}
vcs-repo-file-url: rosinstall
69 changes: 69 additions & 0 deletions .github/workflows/systemtests.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,69 @@
name: System Tests

on:
push:
branches: [ "feature-systemtests-better" ]
# manual trigger
workflow_dispatch:

jobs:
build:
runs-on: self-hosted
steps:
- name: Create workspace
id: step1
run: |
cd ros2_ws/src || mkdir -p ros2_ws/src
- name: Checkout motion capture package
id: step2
run: |
cd ros2_ws/src
ls motion_capture_tracking || git clone --branch ros2 --recursive https://github.com/IMRCLab/motion_capture_tracking.git
- name: Checkout Crazyswarm2
id: step3
uses: actions/checkout@v4
with:
path: ros2_ws/src/crazyswarm2
submodules: 'recursive'
- name: Build workspace
id: step4
run: |
source /opt/ros/humble/setup.bash
cd ros2_ws
colcon build --symlink-install --cmake-args -DCMAKE_BUILD_TYPE=Release
- name: Flight test
id: step5
run: |
cd ros2_ws
source /opt/ros/humble/setup.bash
. install/local_setup.bash
export ROS_LOCALHOST_ONLY=1
export ROS_DOMAIN_ID=99
python3 src/crazyswarm2/systemtests/test_flights.py
- name: Upload files
id: step6
if: '!cancelled()'
uses: actions/upload-artifact@v3
with:
name: pdf_rosbags_and_logs
path: |
ros2_ws/results

# - name: build and test ROS 2
# uses: ros-tooling/[email protected]
# with:
# package-name: |
# crazyflie
# crazyflie_examples
# crazyflie_interfaces
# crazyflie_py
# crazyflie_sim
# target-ros2-distro: humble
# vcs-repo-file-url: rosinstall
77 changes: 77 additions & 0 deletions .github/workflows/systemtests_sim.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,77 @@
name: System Tests Simulation

on:
push:
branches: [ main ]
pull_request:
branches: [ main ]
# manual trigger
workflow_dispatch:

jobs:
build:
runs-on: self-hosted
steps:
- name: Build firmware
id: step1
run: |
ls crazyflie-firmware || git clone --recursive https://github.com/bitcraze/crazyflie-firmware.git
cd crazyflie-firmware
git pull
git submodule sync
git submodule update --init --recursive
make cf2_defconfig
make bindings_python
cd build
python3 setup.py install --user
- name: Create workspace
id: step2
run: |
cd ros2_ws/src || mkdir -p ros2_ws/src
- name: Checkout motion capture package
id: step3
run: |
cd ros2_ws/src
ls motion_capture_tracking || git clone --branch ros2 --recursive https://github.com/IMRCLab/motion_capture_tracking.git
cd motion_capture_tracking
git pull
git submodule sync
git submodule update --recursive --init
- name: Checkout Crazyswarm2
id: step4
uses: actions/checkout@v4
with:
path: ros2_ws/src/crazyswarm2
submodules: 'recursive'
- name: Build workspace
id: step5
run: |
source /opt/ros/humble/setup.bash
cd ros2_ws
colcon build --symlink-install --cmake-args -DCMAKE_BUILD_TYPE=Release
- name: Flight test
id: step6
run: |
cd ros2_ws
source /opt/ros/humble/setup.bash
. install/local_setup.bash
export PYTHONPATH="${PYTHONPATH}:/home/github/actions-runner/_work/crazyswarm2/crazyswarm2/crazyflie-firmware/build/"
export ROS_LOCALHOST_ONLY=1
export ROS_DOMAIN_ID=99
python3 src/crazyswarm2/systemtests/test_flights.py --sim -v #-v is verbose argument of unittest
- name: Upload files
id: step7
if: '!cancelled()'
uses: actions/upload-artifact@v3
with:
name: pdf_rosbags_and_logs
path: |
ros2_ws/results
9 changes: 8 additions & 1 deletion crazyflie/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -85,6 +85,7 @@ ament_target_dependencies(crazyflie_server
# Install C++ executables
install(TARGETS
# crazyflie_tools
comCheck
scan
listParams
listLogVariables
Expand All @@ -95,6 +96,7 @@ install(TARGETS
console
log
setParam
downloadUSDLogfile
#
teleop
crazyflie_server
Expand All @@ -106,13 +108,18 @@ install(PROGRAMS
scripts/chooser.py
scripts/vel_mux.py
scripts/cfmult.py
scripts/simple_mapper_multiranger.py
scripts/aideck_streamer.py
scripts/gui.py
scripts/flash.py
DESTINATION lib/${PROJECT_NAME}
)

# Install launch and config files.
# Install launch, config, and urdf files.
install(DIRECTORY
launch
config
urdf
DESTINATION share/${PROJECT_NAME}/
)

Expand Down
30 changes: 30 additions & 0 deletions crazyflie/config/aideck_streamer.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
image_topic: /camera/image
camera_info_topic: /camera/camera_info
deck_ip: "192.168.4.1"
deck_port: 5000
image_width: 324
image_height: 324
camera_name: crazyflie
camera_matrix:
rows: 3
cols: 3
data: [181.87464, 0. , 162.52301,
0. , 182.58129, 160.79418,
0. , 0. , 1. ]
distortion_model: plumb_bob
distortion_coefficients:
rows: 1
cols: 5
data: [-0.070366, -0.006434, -0.002691, -0.001983, 0.000000]
rectification_matrix:
rows: 3
cols: 3
data: [1., 0., 0.,
0., 1., 0.,
0., 0., 1.]
projection_matrix:
rows: 3
cols: 4
data: [169.24555, 0. , 161.54541, 0. ,
0. , 169.97813, 159.07974, 0. ,
0. , 0. , 1. , 0. ]
39 changes: 35 additions & 4 deletions crazyflie/config/config.rviz
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ Visualization Manager:
Name: TF
Show Arrows: true
Show Axes: true
Show Names: false
Show Names: true
Tree:
world:
cf33:
Expand All @@ -74,6 +74,37 @@ Visualization Manager:
{}
Update Interval: 0
Value: true
- Alpha: 1
Class: rviz_default_plugins/RobotModel
Collision Enabled: false
Description File: ""
Description Source: Topic
Description Topic:
Depth: 5
Durability Policy: Volatile
History Policy: Keep Last
Reliability Policy: Reliable
Value: /cf231/robot_description
Enabled: true
Links:
All Links Enabled: true
Expand Joint Details: false
Expand Link Details: false
Expand Tree: false
Link Tree Style: Links in Alphabetic Order
cf231:
Alpha: 1
Show Axes: false
Show Trail: false
Value: true
Mass Properties:
Inertia: false
Mass: false
Name: CF231
TF Prefix: ""
Update Interval: 0
Value: true
Visual Enabled: true
Enabled: true
Global Options:
Background Color: 48; 48; 48
Expand Down Expand Up @@ -127,9 +158,9 @@ Visualization Manager:
Swap Stereo Eyes: false
Value: false
Focal Point:
X: 0
Y: 0
Z: 0
X: -0.028163839131593704
Y: -0.049007341265678406
Z: -0.025782346725463867
Focal Shape Fixed Size: true
Focal Shape Size: 0.05000000074505806
Invert Z Axis: false
Expand Down
6 changes: 6 additions & 0 deletions crazyflie/config/server.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,12 @@
frequency: 1.0 # report/run checks once per second
motion_capture:
warning_if_rate_outside: [140.0, 160.0]
communication:
max_unicast_latency: 10.0 # ms
min_unicast_ack_rate: 0.9
min_unicast_receive_rate: 0.9 # requires status topic to be enabled
min_broadcast_receive_rate: 0.9 # requires status topic to be enabled
publish_stats: false
firmware_params:
query_all_values_on_connect: False
# simulation related
Expand Down
5 changes: 4 additions & 1 deletion crazyflie/config/teleop.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -52,4 +52,7 @@
land:
button: 6 # 6 back
emergency:
button: 1 # 1 red
button: 1 # 1 red
arm:
button: 3 # yellow

Loading

0 comments on commit 5d9aa42

Please sign in to comment.