Skip to content

Commit

Permalink
refreshed the examples for the new system
Browse files Browse the repository at this point in the history
  • Loading branch information
klaxalk committed Nov 2, 2023
1 parent 99c8a2f commit 35a91ea
Show file tree
Hide file tree
Showing 98 changed files with 4,527 additions and 589 deletions.
12 changes: 0 additions & 12 deletions .ci/build.sh

This file was deleted.

32 changes: 0 additions & 32 deletions .ci/install.sh

This file was deleted.

42 changes: 0 additions & 42 deletions .github/workflows/noetic.yml

This file was deleted.

25 changes: 25 additions & 0 deletions .github/workflows/ros_build_test.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
name: ros_build_test

on:

push:
branches: [ master ]

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

pull_request:
branches: [ master ]

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 }}
2 changes: 0 additions & 2 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,4 +1,2 @@
.gitman

*.swp
*.swo
102 changes: 0 additions & 102 deletions .gitman.yml

This file was deleted.

31 changes: 20 additions & 11 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,15 +1,24 @@
# Example packages
# MRS Core Examples

| Build status | [![Build Status](https://github.com/ctu-mrs/example_ros_packages/workflows/Melodic/badge.svg)](https://github.com/ctu-mrs/example_ros_packages/actions) | [![Build Status](https://github.com/ctu-mrs/example_ros_packages/workflows/Noetic/badge.svg)](https://github.com/ctu-mrs/example_ros_packages/actions) |
|--------------|---------------------------------------------------------------------------------------------------------------------------------------------------------|--------------------------------------------------------------------------------------------------------------------------------------------------------|

This repository includes other ROS packages, demonstrating some basic functionality to get you started.
You can test these in simulation (see our [simulation tutorial](https://ctu-mrs.github.io/docs/simulation/howto.html)).
Follow our **[How to manager ROS workspaces](https://ctu-mrs.github.io/docs/system/managing_ros_workspaces.html)** guide to learn **how to set up** a custom workspace.
This repository includes Core ROS examples for the [MRS UAV System](https://github.com/ctu-mrs/mrs_uav_system).

## Packages

* [example_ros_uav_simple](https://github.com/ctu-mrs/example_ros_uav_simple) - Example of a simple nodelet
* [example_ros_uav](https://github.com/ctu-mrs/example_ros_uav) - Example of UAV control
* [example_ros_vision](https://github.com/ctu-mrs/example_ros_vision) - Example of UAV computer vision
* [example_ros_pluginlib](https://github.com/ctu-mrs/example_ros_pluginlib) - Example of ROS Pluginlib, similar to how it is used in the [ControlManager](https://github.com/ctu-mrs/mrs_uav_managers)
* [waypoint_flier_simple](./waypoint_flier_simple) - Minimalistic C++ Nodelet with "_vanilla_" ROS features
* [waypoint_flier](./waypoint_flier) - Full C++ Nodelet with "_MRS_" libraries and wrappers
* [controller_plugin](./controller_plugin) - Example of Controller plugin for the [ControlManager](https://github.com/ctu-mrs/mrs_uav_managers)
* [tracker_plugin](./tracker_plugin) - Example of Tracker plugin for the [ControlManager](https://github.com/ctu-mrs/mrs_uav_managers)
* [pluginlib_example](./pluginlib_example) - Example of ROS Pluginlib, similar to how it is used in the [ControlManager](https://github.com/ctu-mrs/mrs_uav_managers)

# Disclaimer

THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
82 changes: 82 additions & 0 deletions controller_plugin/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,82 @@
cmake_minimum_required(VERSION 3.1.2)
project(example_controller_plugin)

set(CATKIN_DEPENDENCIES
cmake_modules
roscpp
rospy
pluginlib
geometry_msgs
dynamic_reconfigure
mrs_uav_managers
mrs_msgs
mrs_lib
)

find_package(catkin REQUIRED COMPONENTS
${CATKIN_DEPENDENCIES}
)

generate_dynamic_reconfigure_options(
cfg/example_controller.cfg
)

set(CMAKE_CXX_STANDARD 17)
set(CMAKE_CXX_STANDARD_REQUIRED ON)

set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wall -Wextra")

find_package(Eigen3 REQUIRED)
set(Eigen_INCLUDE_DIRS ${EIGEN3_INCLUDE_DIRS})
set(Eigen_LIBRARIES ${Eigen_LIBRARIES})

set(LIBRARIES
ExampleController
)

catkin_package(
INCLUDE_DIRS include
CATKIN_DEPENDS ${CATKIN_DEPENDENCIES}
LIBRARIES ${LIBRARIES}
DEPENDS Eigen
)

include_directories(
include
${catkin_INCLUDE_DIRS}
${dynamic_reconfigure_PACKAGE_PATH}/cmake/cfgbuild.cmake
)

# Example Controller

add_library(ExampleController
src/example_controller.cpp
)

add_dependencies(ExampleController
${${PROJECT_NAME}_EXPORTED_TARGETS}
${catkin_EXPORTED_TARGETS}
${PROJECT_NAME}_gencfg
)

target_link_libraries(ExampleController
${catkin_LIBRARIES}
)

## --------------------------------------------------------------
## | Install |
## --------------------------------------------------------------

install(TARGETS ${LIBRARIES}
ARCHIVE DESTINATION ${CATKIN_PACKAGE_LIB_DESTINATION}
LIBRARY DESTINATION ${CATKIN_PACKAGE_LIB_DESTINATION}
RUNTIME DESTINATION ${CATKIN_GLOBAL_BIN_DESTINATION}
)

install(DIRECTORY config
DESTINATION ${CATKIN_PACKAGE_SHARE_DESTINATION}
)

install(FILES plugins.xml
DESTINATION ${CATKIN_PACKAGE_SHARE_DESTINATION}
)
3 changes: 3 additions & 0 deletions controller_plugin/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
# example_controller_plugin

Example controller plugin for the MRS Control Manager.
21 changes: 21 additions & 0 deletions controller_plugin/cfg/example_controller.cfg
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
#!/usr/bin/env python
PACKAGE = "example_controller_plugin"

import roslib;
roslib.load_manifest(PACKAGE)

from dynamic_reconfigure.parameter_generator_catkin import *

gen = ParameterGenerator()

orientation = gen.add_group("Desired orientation");

orientation.add("roll", double_t, 0, "Desired roll", 0.0, -3.14, 3.14)
orientation.add("pitch", double_t, 0, "Desired pitch", 0.0, -3.14, 3.14)
orientation.add("yaw", double_t, 0, "Desired pitch", 0.0, -3.14, 3.14)

force = gen.add_group("Desired force relative to hover");

force.add("force", double_t, 0, "Desired force", 0.0, -10.0, 10.0)

exit(gen.generate(PACKAGE, "ExampleController", "example_controller"))
4 changes: 4 additions & 0 deletions controller_plugin/config/example_controller.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
desired_roll: 0.03 # [rad]
desired_pitch: 0.02 # [rad]
desired_yaw: 0.1 # [rad]
desired_thrust_force: 0.2 # [N], additional to gravity compensation
Loading

0 comments on commit 35a91ea

Please sign in to comment.