Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Develop #1

Closed
wants to merge 8 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
95 changes: 84 additions & 11 deletions .github/workflows/ros_build_test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,23 +3,96 @@ name: ros_build_test
on:

push:
branches: [ devel ]

paths-ignore:
- '**/README.md'

pull_request:
branches: [ master ]
pull_request:

workflow_dispatch:

concurrency:
group: ${{ github.ref }}
cancel-in-progress: true


jobs:

build:
uses: ctu-mrs/ci_scripts/.github/workflows/ros_build_test.yml@master
secrets:
PUSH_TOKEN: ${{ secrets.PUSH_TOKEN }}
build_amd64:
runs-on: ubuntu-20.04

steps:

- uses: actions/checkout@v3
with:
fetch-depth: 0
submodules: 'recursive'

- name: Checkout CI scripts
uses: actions/checkout@v3
with:
repository: ctu-mrs/ci_scripts
ref: master
path: .ci_scripts

- name: Update submodules
run: |
sudo pip3 install -U gitman
[[ -e .gitman.yml || -e .gitman.yaml ]] && [[ ! -e .gitman_ignore ]] && gitman install || echo "no gitman modules to install"

- name: Build
run: |
mkdir -p /tmp/artifacts
.ci_scripts/package_build/build_package.sh $GITHUB_WORKSPACE /tmp/artifacts

build_arm64:

runs-on: ubuntu-20.04

steps:
- uses: actions/checkout@v3
with:
fetch-depth: 0
submodules: 'recursive'

- name: Checkout CI scripts
uses: actions/checkout@v3
with:
repository: ctu-mrs/ci_scripts
ref: master
path: .ci_scripts

- name: Update submodules
run: |
sudo pip3 install -U gitman
[[ -e .gitman.yml || -e .gitman.yaml ]] && [[ ! -e .gitman_ignore ]] && gitman install || echo "no gitman modules to install"

- uses: ctu-mrs/run-on-arch-action@master
name: Build artifact

id: build

with:
arch: aarch64
distro: noetic

githubToken: ${{ github.token }}

# Create an artifacts directory
setup: |
mkdir -p "/tmp/artifacts"
mkdir -p "/tmp/repository"

# Mount the artifacts directory as /artifacts in the container
dockerRunArgs: |
--volume "$PWD:/tmp/repository"
--volume "/tmp/artifacts:/tmp/artifacts"

# The shell to run commands with in the container
shell: /bin/sh

install: |
apt-get update -q -y
apt-get upgrade -q -y

# Produce a binary artifact and place it in the mounted volume
run: |
git config --global --add safe.directory "*"
/tmp/repository/.ci_scripts/package_build/build_package.sh /tmp/repository /tmp/artifacts

22 changes: 0 additions & 22 deletions .github/workflows/ros_package_build.yml

This file was deleted.

10 changes: 5 additions & 5 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
cmake_minimum_required(VERSION 3.5)
project(mrs_uav_px4_api)
project(mrs_usv_ardurover_api)

set(CATKIN_DEPENDENCIES
cmake_modules
Expand All @@ -26,7 +26,7 @@ set(CMAKE_CXX_STANDARD 17)
set(CMAKE_CXX_STANDARD_REQUIRED ON)

set(LIBRARIES
MrsUavPx4Api_Api
MrsUsvArduroverApi_Api
)

catkin_package(
Expand All @@ -40,16 +40,16 @@ include_directories(

# Plugin

add_library(MrsUavPx4Api_Api
add_library(MrsUsvArduroverApi_Api
src/api.cpp
)

add_dependencies(MrsUavPx4Api_Api
add_dependencies(MrsUsvArduroverApi_Api
${${PROJECT_NAME}_EXPORTED_TARGETS}
${catkin_EXPORTED_TARGETS}
)

target_link_libraries(MrsUavPx4Api_Api
target_link_libraries(MrsUsvArduroverApi_Api
${catkin_LIBRARIES}
${Eigen_LIBRARIES}
)
Expand Down
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# MRS UAV PX4 API Plugin
# MRS USV ArduPilot Rover API Plugin

[MRS HW Api](https://github.com/ctu-mrs/mrs_uav_hw_api) plugin for interfacing the [UAV Core](https://github.com/ctu-mrs/mrs_uav_core) with the PX4 autopilot.
[MRS HW Api](https://github.com/ctu-mrs/mrs_uav_hw_api) plugin for interfacing the [UAV Core](https://github.com/ctu-mrs/mrs_uav_core) with the ArduPilot Rover for BlueBoat.

> :warning: **Attention please: This README is outdated.**
>
Expand Down
16 changes: 10 additions & 6 deletions config/px4_api.yaml → config/ardurover_api.yaml
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
hw_interface_plugin: "mrs_uav_px4_api/Api"
hw_interface_plugin: "mrs_usv_ardurover_api/Api"

mavros_timeout: 1.0 # [s]
mavros_timeout: 5.0 # [s]

position_cmd_map: true

simulated_rtk:
utm_zone: "32T"
Expand All @@ -9,19 +11,21 @@ simulated_rtk:
amsl: 340.0

inputs:
position: true
control_group: false
attitude_rate: true
attitude: true
attitude_rate: false
attitude: false
velocity_hdg_rate: true

outputs:
distance_sensor: true
distance_sensor: false
gnss: true
rtk: true
imu: true
altitude: true
magnetometer_heading: true
magnetic_field: true
rc_channels: true
rc_channels: false
battery_state: true
position: true
orientation: true
Expand Down
49 changes: 31 additions & 18 deletions launch/api.launch
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@
<arg name="UAV_NAME" default="$(optenv UAV_NAME)" />
<arg name="LOGGER_DEBUG" default="$(optenv LOGGER_DEBUG false)" />
<arg name="RUN_TYPE" default="$(optenv RUN_TYPE uav)" />
<arg name="OLD_PX4_FW" default="$(optenv OLD_PX4_FW 0)" />

<!-- other args -->
<arg name="debug" default="false" />
Expand All @@ -26,7 +25,7 @@
<node pkg="nodelet" type="nodelet" name="hw_api" args="$(arg nodelet) mrs_uav_hw_api/HwApiManager $(arg nodelet_manager)" output="screen" launch-prefix="$(arg launch_prefix)">

<rosparam file="$(find mrs_uav_hw_api)/config/hw_api.yaml" />
<rosparam file="$(find mrs_uav_px4_api)/config/px4_api.yaml" />
<rosparam file="$(find mrs_usv_ardurover_api)/config/ardurover_api.yaml" />

<!-- Load a user param file -->
<rosparam if="$(eval not arg('custom_config') == '')" file="$(arg custom_config)" />
Expand All @@ -36,23 +35,37 @@
<param name="uav_name" type="string" value="$(arg UAV_NAME)" />
<param name="simulation" type="bool" value="$(eval arg('RUN_TYPE') == 'simulation')" />

<!-- Topics -->
<remap if="$(eval arg('RUN_TYPE') == 'simulation')" from="~ground_truth_in" to="ground_truth" />
<remap if="$(eval arg('RUN_TYPE') == 'realworld')" from="~rtk_in" to="rtk/bestpos" />
<remap from="~mavros_state_in" to="mavros/state" />
<remap if="$(eval arg('OLD_PX4_FW') == 0)" from="~mavros_local_position_in" to="mavros/odometry/in" />
<remap if="$(eval arg('OLD_PX4_FW') == 1)" from="~mavros_local_position_in" to="mavros/local_position/odom" />
<remap from="~mavros_global_position_in" to="mavros/global_position/global" />
<remap from="~mavros_garmin_in" to="mavros/distance_sensor/garmin" />
<remap from="~mavros_imu_in" to="mavros/imu/data" />
<remap from="~mavros_magnetometer_in" to="mavros/global_position/compass_hdg" />
<remap from="~mavros_magnetic_field_in" to="mavros/imu/mag" />
<remap from="~mavros_rc_in" to="mavros/rc/in" />
<remap from="~mavros_altitude_in" to="mavros/altitude" />
<remap from="~mavros_battery_in" to="mavros/battery" />
<remap from="~mavros_cmd_out" to="mavros/cmd/command" />
<remap from="~mavros_set_mode_out" to="mavros/set_mode" />
<remap from="~mavros_attitude_setpoint_out" to="mavros/setpoint_raw/attitude" />
<remap from="~mavros_actuator_control_out" to="mavros/actuator_control" />
<remap if="$(eval arg('RUN_TYPE') == 'realworld')" from="~rtk_in" to="/uav/rtk/bestpos" />

<remap from="~mavros_state_in" to="/mavros/state" />

<remap from="~mavros_local_position_in" to="/mavros/local_position/odom" />

<remap from="~mavros_global_position_in" to="/mavros/global_position/global" />
<remap from="~mavros_imu_in" to="/mavros/imu/data" />
<remap from="~mavros_magnetometer_in" to="/mavros/global_position/compass_hdg" />
<remap from="~mavros_magnetic_field_in" to="/mavros/imu/mag" />
<remap from="~mavros_rc_in" to="/mavros/rc/in" />
<remap from="~mavros_battery_in" to="/mavros/battery" />

<remap from="~mavros_position_setpoint_out" to="/mavros/setpoint_raw/local" />
<remap from="~mavros_velocity_setpoint_out" to="/mavros/setpoint_velocity/cmd_vel_unstamped" />
<remap from="~mavros_attitude_setpoint_out" to="/mavros/setpoint_raw/attitude" />
<remap from="~mavros_actuator_control_out" to="/mavros/actuator_control" />
<remap from="~mavros_cmd_out" to="/mavros/cmd/command" />
<remap from="~mavros_set_mode_out" to="/mavros/set_mode" />

<remap from="~left_usv_thrust_cmd_out" to="/wamv/thrusters/left_thrust_cmd" />
<remap from="~right_usv_thrust_cmd_out" to="/wamv/thrusters/right_thrust_cmd" />
<remap from="~left_usv_thrust_angle_out" to="/wamv/thrusters/left_thrust_angle" />
<remap from="~right_usv_thrust_angle_out" to="/wamv/thrusters/right_thrust_angle" />

<!-- NO DATA -->
<remap from="~mavros_altitude_in" to="/mavros/altitude" />
<remap from="~mavros_garmin_in" to="/mavros/distance_sensor/garmin" />


</node>

Expand Down
8 changes: 4 additions & 4 deletions package.xml
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
<?xml version="1.0"?>
<package format="2">

<name>mrs_uav_px4_api</name>
<name>mrs_usv_ardurover_api</name>
<version>1.0.0</version>
<description>PX4 API for MRS UAV System</description>
<description>ArduPilot Rover API for MRS UAV System</description>

<author email="tomas.baca@fel.cvut.cz">Tomas Baca</author>
<maintainer email="tomas.baca@fel.cvut.cz">Tomas Baca</maintainer>
<author email="filip.novak@fel.cvut.cz">Filip Novak</author>
<maintainer email="filip.novak@fel.cvut.cz">Filip Novak</maintainer>

<license>BSD 3-Clause</license>

Expand Down
6 changes: 3 additions & 3 deletions plugins.xml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<library path="lib/libMrsUavPx4Api_Api">
<class name="mrs_uav_px4_api/Api" type="mrs_uav_px4_api::MrsUavPx4Api" base_class_type="mrs_uav_hw_api::MrsUavHwApi">
<description>PX4 API module for the MRS UAV System</description>
<library path="lib/libMrsUsvArduroverApi_Api">
<class name="mrs_usv_ardurover_api/Api" type="mrs_usv_ardurover_api::MrsUsvArduroverApi" base_class_type="mrs_uav_hw_api::MrsUavHwApi">
<description>ArduPilot Rover API module for the MRS UAV System</description>
</class>
</library>
Loading
Loading