Skip to content

Commit

Permalink
Merge branch 'main' into kp/job-manager
Browse files Browse the repository at this point in the history
Signed-off-by: Luca Della Vedova <lucadv@intrinsic.ai>
  • Loading branch information
luca-della-vedova committed Nov 27, 2024
2 parents 5455f87 + 0741639 commit bf52905
Show file tree
Hide file tree
Showing 82 changed files with 2,149 additions and 143 deletions.
8 changes: 2 additions & 6 deletions .github/workflows/nexus_integration_tests.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -11,18 +11,14 @@ jobs:
runs-on: ubuntu-latest
strategy:
matrix:
docker_image: ['ros:iron-ros-base']
docker_image: ['ros:jazzy-ros-base']
container:
image: ${{ matrix.docker_image }}
timeout-minutes: 60
steps:
- name: Install deps for Rust
run: |
apt update && apt install -y git curl libclang-dev
- name: Setup Rust for nexus_zenoh_bridge
uses: dtolnay/rust-toolchain@stable
with:
components: clippy, rustfmt
- uses: actions/checkout@v2
- uses: actions/cache@v3
with:
Expand All @@ -40,7 +36,7 @@ jobs:
rosdep update
rosdep install --from-paths . -yir
- name: build
run: /ros_entrypoint.sh colcon build --packages-up-to nexus_integration_tests nexus_motion_planner --mixin release lld --cmake-args -DCMAKE_CXX_COMPILER_LAUNCHER=ccache
run: /ros_entrypoint.sh colcon build --packages-up-to nexus_calibration nexus_gazebo nexus_integration_tests nexus_motion_planner --mixin release lld --cmake-args -DCMAKE_CXX_COMPILER_LAUNCHER=ccache
- name: Test - Unit Tests
run: . ./install/setup.bash && RMW_IMPLEMENTATION=rmw_cyclonedds_cpp /ros_entrypoint.sh colcon test --packages-select nexus_motion_planner --event-handlers=console_direct+
- name: Test - Integration Test
Expand Down
45 changes: 45 additions & 0 deletions .github/workflows/nexus_workcell_editor.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
name: workcell_editor
on:
pull_request:
push:
branches: [ main ]
defaults:
run:
shell: bash
jobs:
test:
runs-on: ubuntu-latest
strategy:
matrix:
docker_image: ['ros:jazzy-ros-base']
container:
image: ${{ matrix.docker_image }}
timeout-minutes: 30
steps:
- name: Deps
run: |
apt update && apt install -y git curl libclang-dev libasound2-dev libudev-dev libgtk-3-dev python3-pip python3-vcstool
- name: Setup Rust
uses: dtolnay/rust-toolchain@1.75
with:
components: clippy, rustfmt
- name: Install colcon cargo
run: |
cargo install --debug cargo-ament-build # --debug is faster to install
pip install colcon-cargo --break-system-packages
pip install colcon-ros-cargo --break-system-packages
- uses: actions/checkout@v2
- name: vcs
# TODO(luca) Go back to cloning a tag when a new version is released with jazzy repos file
run: |
git clone https://github.com/ros2-rust/ros2_rust.git
cd ros2_rust
git checkout f45a66f47dc727e3ccb13037a6c57923af1446c7
cd ..
vcs import . < ros2_rust/ros2_rust_jazzy.repos
- name: rosdep
run: |
rosdep update
rosdep install --from-paths . -yir
- name: build
run: /ros_entrypoint.sh colcon build --packages-up-to nexus_workcell_editor
18 changes: 13 additions & 5 deletions .github/workflows/style.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -11,17 +11,25 @@ jobs:
runs-on: ubuntu-latest
strategy:
matrix:
docker_image: ['ros:iron-ros-base']
docker_image: ['ros:jazzy-ros-base']
container:
image: ${{ matrix.docker_image }}
steps:
- name: checkout
uses: actions/checkout@v2
- name: uncrustify
run: |
sudo apt update && sudo apt install -y ros-iron-rmf-utils
/ros_entrypoint.sh ament_uncrustify -c /opt/ros/iron/share/rmf_utils/rmf_code_style.cfg . --language C++ --exclude nexus_endpoints/nexus_endpoints.hpp
# TODO(luca) reintroduce after formatting
#- name: uncrustify
# run: |
# sudo apt update && sudo apt install -y ros-jazzy-rmf-utils
# /ros_entrypoint.sh ament_uncrustify -c /opt/ros/jazzy/share/rmf_utils/rmf_code_style.cfg . --language C++ --exclude nexus_endpoints/nexus_endpoints.hpp
- name: pycodestyle
run: |
sudo apt update && sudo apt install -y pycodestyle curl
pycodestyle nexus_network_configuration/
- name: Setup Rust
uses: dtolnay/rust-toolchain@1.75
with:
components: clippy, rustfmt
- name: rustfmt
run: |
rustfmt --check --edition 2021 nexus_workcell_editor/src/main.rs
17 changes: 9 additions & 8 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
# NEXUS
![](https://github.com/osrf/nexus/workflows/style/badge.svg)
![](https://github.com/osrf/nexus/workflows/integration_tests/badge.svg)
[![style](https://github.com/osrf/nexus/actions/workflows/style.yaml/badge.svg)](https://github.com/osrf/nexus/actions/workflows/style.yaml)
[![integration_tests](https://github.com/osrf/nexus/actions/workflows/nexus_integration_tests.yaml/badge.svg)](https://github.com/osrf/nexus/actions/workflows/nexus_integration_tests.yaml)
[![workcell_editor](https://github.com/osrf/nexus/actions/workflows/nexus_workcell_editor.yaml/badge.svg)](https://github.com/osrf/nexus/actions/workflows/nexus_workcell_editor.yaml)

![](./docs/media/nexus_architecture.png)

Expand All @@ -9,7 +10,7 @@ A ROS 2 framework which enables configuration and orchestration of process workf
For details on architecture and concepts [see](./docs/concepts.md).

## Requirements
* [ROS 2 Iron](https://docs.ros.org/en/iron/Installation/Ubuntu-Install-Debians.html) on `Ubuntu 22.04`
* [ROS 2 Jazzy](https://docs.ros.org/en/jazzy/Installation/Ubuntu-Install-Debians.html) on `Ubuntu 24.04`

## Setup

Expand All @@ -33,12 +34,12 @@ cd ~/ws_nexus/src/
git clone git@github.com:osrf/nexus
vcs import . < nexus/abb.repos
cd ~/ws_nexus
rosdep install --from-paths src --ignore-src --rosdistro iron -y -r
rosdep install --from-paths src --ignore-src --rosdistro jazzy -y -r
```

### Build the NEXUS workspace
```bash
source /opt/ros/iron/setup.bash
source /opt/ros/jazzy/setup.bash
colcon build --cmake-args -DCMAKE_BUILD_TYPE=Release
```

Expand Down Expand Up @@ -102,10 +103,10 @@ The linter of choice is `uncrustify` and the configuration used may be reference
Instead of invoking `uncrustify` directly, use `ament_uncrustify` instead which is a wrapper around a specific version of `uncrustify`.
You may locally run the linter as follows
```bash
sudo apt update && sudo apt install -y ros-iron-rmf-utils # This is a one-time step
source /opt/ros/iron/setup.bash
sudo apt update && sudo apt install -y ros-jazzy-rmf-utils # This is a one-time step
source /opt/ros/jazzy/setup.bash
cd ~/ws_nexus/src/nexus
ament_uncrustify -c /opt/ros/iron/share/rmf_utils/rmf_code_style.cfg . --language C++ --exclude nexus_endpoints/nexus_endpoints.hpp
ament_uncrustify -c /opt/ros/jazzy/share/rmf_utils/rmf_code_style.cfg . --language C++ --exclude nexus_endpoints/nexus_endpoints.hpp
```
To automatically reformat the code, append `--reformat` to the `ament_uncrustify` line above.
It is highly recommended to audit the changes by the linter before committing.
Expand Down
10 changes: 10 additions & 0 deletions nexus_calibration/CHANGELOG.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
Changelog for package nexus_calibration
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

0.1.1 (2023-11-22)
------------------

0.1.0 (2023-11-06)
------------------
* Provides ``nexus_calibration_node`` which can be queried for poses of calibration links within a workcell.
49 changes: 49 additions & 0 deletions nexus_calibration/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
cmake_minimum_required(VERSION 3.8)
project(nexus_calibration)

if(CMAKE_COMPILER_IS_GNUCXX OR CMAKE_CXX_COMPILER_ID MATCHES "Clang")
add_compile_options(-Wall -Wextra -Wpedantic)
endif()

# find dependencies
find_package(ament_cmake REQUIRED)
set(dep_pkgs
nexus_endpoints
rclcpp
rclcpp_components
rclcpp_lifecycle
tf2
VRPN
)
foreach(pkg ${dep_pkgs})
find_package(${pkg} REQUIRED)
endforeach()

#===============================================================================
add_library(nexus_calibration_component SHARED src/calibration_node.cpp)

ament_target_dependencies(nexus_calibration_component ${dep_pkgs})

target_compile_features(nexus_calibration_component INTERFACE cxx_std_17)

rclcpp_components_register_node(nexus_calibration_component
PLUGIN "nexus::CalibrationNode"
EXECUTABLE nexus_calibration_node
EXECUTOR SingleThreadedExecutor)


#===============================================================================
if(BUILD_TESTING)

endif()

#===============================================================================
install(
TARGETS
nexus_calibration_component
RUNTIME DESTINATION lib/${PROJECT_NAME}
LIBRARY DESTINATION lib
ARCHIVE DESTINATION lib
)

ament_package()
15 changes: 15 additions & 0 deletions nexus_calibration/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
## nexus_calibration

This package provides a ROS 2 Lifecyle node, `nexus_calibration_node`, that connects to a [VRPN](https://vrpn.github.io/) server and builds a cache of rigid body poses in a local `TF2` buffer.
These rigid bodies could represent calibration links (or reference links) on components within a workcell.
The poses of these links can then be queried via a ROS 2 service call over the `nexus::endpoints::ExtrinsicCalibrationService` endpoint.

## Test
```bash
cd nexus_calibration/
ros2 launch test/nexus_calibration.launch.py
``
Then to retrieve poses of components wrt to the `robot_calibration_link`, ie a reference frame on the robot's `base_link`,
```bash
ros2 service call /workcell_1/calibrate_extrinsics nexus_calibration_msgs/src/CalibrateExtrinsics '{frame_id: robot_calibration_link}'
```
7 changes: 7 additions & 0 deletions nexus_calibration/config/sample_config.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
nexus_calibration_node:
ros__parameters:
vrpn_server_address: "localhost:3883" # The ip_address:port of the vrpn server.
vrpn_frame_id: "world" # The calibrated reference frame wrt which the vrpn server is streaming data.
workcell_id: "workcell_1" # The name of the workcell. This is used as a prefix for any endpoints.
tracker_names: ["workcell_calibration_link", "robot_calibration_link"] # The names of the relevant rigid bodies trackers.
update_rate: 2.0 # The rate in hz at which the update loop should run.
24 changes: 24 additions & 0 deletions nexus_calibration/package.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
<?xml version="1.0"?>
<?xml-model href="http://download.ros.org/schema/package_format3.xsd" schematypens="http://www.w3.org/2001/XMLSchema"?>
<package format="3">
<name>nexus_calibration</name>
<version>0.1.1</version>
<description>A package with ROS 2 nodes for calibration workcell components</description>
<maintainer email="yadunund@openrobotics.org">Yadunund</maintainer>
<license>Apache License 2.0</license>

<buildtool_depend>ament_cmake</buildtool_depend>

<depend>nexus_endpoints</depend>
<depend>rclcpp</depend>
<depend>rclcpp_components</depend>
<depend>rclcpp_lifecycle</depend>
<depend>tf2</depend>
<depend>vrpn</depend>

<test_depend>nexus_gazebo</test_depend>

<export>
<build_type>ament_cmake</build_type>
</export>
</package>
Loading

0 comments on commit bf52905

Please sign in to comment.