Skip to content

Commit

Permalink
Merge pull request #148 from rosflight/rename_to_rosflight_io
Browse files Browse the repository at this point in the history
Rename rosflight package to rosflight_io
  • Loading branch information
bsutherland333 committed Sep 11, 2023
2 parents 9443ebe + 9b761de commit aeb59c2
Show file tree
Hide file tree
Showing 46 changed files with 118 additions and 430 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/ros2-ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ jobs:
- uses: actions/checkout@v2
with:
submodules: recursive
path: 'ros2_ws/src/rosflight2'
path: 'ros2_ws/src/rosflight'

- name: Install dependencies
run: |
Expand Down
10 changes: 5 additions & 5 deletions .gitmodules
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[submodule "rosflight/include/mavlink/v1.0"]
path = rosflight/include/rosflight/mavlink/v1.0
[submodule "rosflight_io/include/rosflight_io/mavlink/v1.0"]
path = rosflight_io/include/rosflight_io/mavlink/v1.0
url = https://github.com/rosflight/mavlink_c_library.git
[submodule "rosflight_firmware/firmware"]
path = rosflight_firmware/firmware
url = https://github.com/rosflight/firmware
[submodule "rosflight_firmware/rosflight_firmware"]
path = rosflight_firmware/rosflight_firmware
url = https://github.com/rosflight/rosflight_firmware.git
20 changes: 10 additions & 10 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
# ROSflight2
# ROSflight

[![ROS2 CI](https://github.com/rosflight/rosflight2/actions/workflows/ros2-ci.yml/badge.svg)](https://github.com/rosflight/rosflight2/actions/workflows/ros2-ci.yml)
[![ROS2 CI](https://github.com/rosflight/rosflight/actions/workflows/ros2-ci.yml/badge.svg)](https://github.com/rosflight/rosflight/actions/workflows/ros2-ci.yml)

This repository contains a ROS2 stack for interfacing with an autopilot running the ROSflight firmware.
For more information on the ROSflight autopilot firmware stack, visit http://rosflight.org.

# Packages Overview

## rosflight
## rosflight_io

This package contains the rosflight_io node, which provides the core functionality for interfacing an onboard computer
with the autopilot. This node streams autopilot sensor and status data to the onboard computer, streams control
Expand Down Expand Up @@ -91,9 +91,9 @@ The gazebo simulator with the sil_node can be launched alongside rosflight_io an
### Firmware parameter files

Basic parameter files for setting up a multirotor or fixedwing UAV have been provided, under the
`rosflight2/rosflight_utils/params` directory. Use
`ros2 service call /param_load_from_file rosflight_msgs/srv/ParamFile "{filename: "/path_to_rosflight2/rosflight_utils/params/fixedwing_firmware.yaml"}"` for fixedwings and
`ros2 service call /param_load_from_file rosflight_msgs/srv/ParamFile "{filename:"/path_to_rosflight2/rosflight_utils/params/multirotor_firmware.yaml"}"` for multirotors.
`rosflight/rosflight_utils/params` directory. Use
`ros2 service call /param_load_from_file rosflight_msgs/srv/ParamFile "{filename: "/path_to_rosflight/rosflight_utils/params/fixedwing_firmware.yaml"}"` for fixedwings and
`ros2 service call /param_load_from_file rosflight_msgs/srv/ParamFile "{filename:"/path_to_rosflight/rosflight_utils/params/multirotor_firmware.yaml"}"` for multirotors.

### Firmware initialization launch files

Expand All @@ -115,8 +115,8 @@ files found in the `rosflight_utils/params` directory mentioned above.
with `echo "source /opt/ros/humble/setup.bash" >> ~/.bashrc`. Re-open your terminal so that this echo command can
take effect.
4. Create a rosflight workspace folder and cd into it with `mkdir rosflight_ws && cd rosflight_ws`.
5. Clone the rosflight2 repository and its submodules
with `git clone --recursive https://github.com/byu-magicc/rosflight2.git`.
5. Clone the rosflight repository and its submodules
with `git clone --recursive https://github.com/rosflight/rosflight.git`.
6. Install all required dependencies with rosdep. To do so, initialize rosdep with `sudo rosdep init`, update
with `rosdep update`, and install the dependencies
with `rosdep install -i --from-path ./ -y --ignore-src`.
Expand All @@ -129,7 +129,7 @@ files found in the `rosflight_utils/params` directory mentioned above.
## Running the rosflight_io node

To run the rosflight_io node when connected to real hardware, use the
command `ros2 run rosflight rosflight_io --ros-args -p port:=/dev/ttyACM0`, replacing `/dev/ttyACM0` with the location
command `ros2 run rosflight_io rosflight_io --ros-args -p port:=/dev/ttyACM0`, replacing `/dev/ttyACM0` with the location
of serial port connected to the flight controller. This will launch a ROS2 node on your computer that will publish all
sensor topics and create all command subscriptions needed to communicated with the firmware.

Expand All @@ -148,7 +148,7 @@ real sensors it calls Gazebo sensors.
### Launch rosflight_io node

To run the rosflight_io node with the simulator, use the
command `ros2 run rosflight rosflight_io --ros-args -p udp:=true`.
command `ros2 run rosflight_io rosflight_io --ros-args -p udp:=true`.

### Launch RC controller interface node

Expand Down
4 changes: 2 additions & 2 deletions fix_code_style.sh
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,9 @@ SCRIPTPATH=`dirname $SCRIPT`
cd $SCRIPTPATH

# Find all files with ".hpp" or ".cpp" extensions in the current directory and subdirectories,
# excluding certain paths (.rosflight/include/mavlink/v1.0/, ./rosflight_firmware/firmware/, and ./.git)
# excluding certain paths (.rosflight_io/include/mavlink/v1.0/, ./rosflight_firmware/firmware/, and ./.git)
find . -iname "*.hpp" -o -iname "*.cpp" | \
egrep -v "^(.rosflight/include/mavlink/v1.0/|./rosflight_firmware/firmware/|./.git)" | \
egrep -v "^(.rosflight_io/include/mavlink/v1.0/|./rosflight_firmware/firmware/|./.git)" | \

# Format the files according to the rules specified in .clang-format
xargs clang-format -i
55 changes: 28 additions & 27 deletions rosflight_firmware/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -18,10 +18,10 @@ find_package(ament_cmake REQUIRED)
find_package(rclcpp REQUIRED)
find_package(Boost REQUIRED COMPONENTS system thread)

# clone firmware submodule if it is missing
set(FIRMWARE_SUBMODULE_DIR "${CMAKE_CURRENT_SOURCE_DIR}/firmware")
# clone rosflight_firmware submodule if it is missing
set(FIRMWARE_SUBMODULE_DIR "${CMAKE_CURRENT_SOURCE_DIR}/rosflight_firmware")
if(NOT EXISTS "${FIRMWARE_SUBMODULE_DIR}/.git")
message(STATUS "Firmware submodule not found at ${FIRMWARE_SUBMODULE_DIR}")
message(STATUS "rosflight_firmware submodule not found at ${FIRMWARE_SUBMODULE_DIR}")
execute_process(
COMMAND git submodule update --init --recursive
WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}
Expand All @@ -32,12 +32,12 @@ endif()
execute_process(COMMAND git rev-parse --short=8 HEAD
OUTPUT_VARIABLE GIT_VERSION_HASH
OUTPUT_STRIP_TRAILING_WHITESPACE
WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}/firmware)
WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}/rosflight_firmware)

execute_process(COMMAND git describe --tags --abbrev=8 --always --dirty --long
OUTPUT_VARIABLE GIT_VERSION_STRING
OUTPUT_STRIP_TRAILING_WHITESPACE
WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}/firmware)
WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}/rosflight_firmware)

if("${GIT_VERSION_STRING}" STREQUAL "")
set(GIT_VERSION_STRING "undefined")
Expand All @@ -53,10 +53,11 @@ endif()
###########

set(FIRMWARE_INCLUDE_DIRS
firmware/include/
firmware/lib/
firmware/comms/
firmware/test/
rosflight_firmware/include/
rosflight_firmware/lib/
rosflight_firmware/comms/
rosflight_firmware/test/
rosflight_firmware/boards/udp/
)

include_directories(include
Expand All @@ -66,21 +67,21 @@ include_directories(include

# rosflight_firmware
add_library(rosflight_firmware
firmware/src/rosflight.cpp
firmware/src/nanoprintf.cpp
firmware/src/estimator.cpp
firmware/src/mixer.cpp
firmware/src/controller.cpp
firmware/src/param.cpp
firmware/src/state_manager.cpp
firmware/src/rc.cpp
firmware/src/command_manager.cpp
firmware/src/sensors.cpp
firmware/src/comm_manager.cpp

firmware/comms/mavlink/mavlink.cpp

firmware/lib/turbomath/turbomath.cpp
rosflight_firmware/src/rosflight.cpp
rosflight_firmware/src/nanoprintf.cpp
rosflight_firmware/src/estimator.cpp
rosflight_firmware/src/mixer.cpp
rosflight_firmware/src/controller.cpp
rosflight_firmware/src/param.cpp
rosflight_firmware/src/state_manager.cpp
rosflight_firmware/src/rc.cpp
rosflight_firmware/src/command_manager.cpp
rosflight_firmware/src/sensors.cpp
rosflight_firmware/src/comm_manager.cpp

rosflight_firmware/comms/mavlink/mavlink.cpp

rosflight_firmware/lib/turbomath/turbomath.cpp
)
target_compile_definitions(rosflight_firmware PUBLIC
GIT_VERSION_HASH=0x${GIT_VERSION_HASH}
Expand All @@ -98,7 +99,7 @@ install(

# rosflight_udp_board
add_library(rosflight_udp_board
src/udp_board.cpp
rosflight_firmware/boards/udp/udp_board.cpp
)
target_link_libraries(rosflight_udp_board
rosflight_firmware
Expand All @@ -118,7 +119,7 @@ install(

# rosflight_test
add_library(rosflight_test
firmware/test/test_board.cpp
rosflight_firmware/test/test_board.cpp
)
target_link_libraries(rosflight_test
rosflight_firmware
Expand All @@ -135,7 +136,7 @@ install(


install(
DIRECTORY include/${PROJECT_NAME}/ ${FIRMWARE_INCLUDE_DIRS}
DIRECTORY ${PROJECT_NAME}/ ${FIRMWARE_INCLUDE_DIRS}
DESTINATION include
)

Expand Down
1 change: 0 additions & 1 deletion rosflight_firmware/firmware
Submodule firmware deleted from b4685d
123 changes: 0 additions & 123 deletions rosflight_firmware/include/rosflight_firmware/udp_board.hpp

This file was deleted.

4 changes: 2 additions & 2 deletions rosflight_firmware/package.xml
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,8 @@
<license>BSD</license>

<url type="website">https://rosflight.org</url>
<url type="repository">https://github.com/rosflight/rosflight2</url>
<url type="bugtracker">https://github.com/rosflight/rosflight2/issues</url>
<url type="repository">https://github.com/rosflight/rosflight</url>
<url type="bugtracker">https://github.com/rosflight/rosflight/issues</url>

<buildtool_depend>ament_cmake</buildtool_depend>

Expand Down
1 change: 1 addition & 0 deletions rosflight_firmware/rosflight_firmware
Submodule rosflight_firmware added at 5df075
Loading

0 comments on commit aeb59c2

Please sign in to comment.