Skip to content
Merged
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
22 changes: 13 additions & 9 deletions .github/workflows/build.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,22 +3,20 @@ on:
push:
branches: [ main ]
pull_request:
schedule:
- cron: '0 0 * * *'

jobs:
build_and_test:
name: Build and test
runs-on: ubuntu-latest
container:
image: rostooling/setup-ros-docker:ubuntu-focal-latest
strategy:
matrix:
ros_distribution:
- foxy
- galactic
image: rostooling/setup-ros-docker:ubuntu-jammy-latest
steps:
- name: deps
uses: ros-tooling/setup-ros@v0.3
with:
required-ros-distributions: ${{ matrix.ros_distribution }}
required-ros-distributions: humble
- name: install_clang
run: sudo apt update && sudo apt install -y clang clang-tools lld
- name: build
Expand All @@ -27,7 +25,7 @@ jobs:
CC: clang
CXX: clang++
with:
target-ros2-distro: ${{ matrix.ros_distribution }}
target-ros2-distro: humble
# build all packages listed in the meta package
package-name: |
rmf_visualization
Expand All @@ -39,14 +37,20 @@ jobs:
rmf_visualization_rviz2_plugins
rmf_visualization_schedule
vcs-repo-file-url: |
https://raw.githubusercontent.com/open-rmf/rmf/main/rmf.repos
https://raw.githubusercontent.com/open-rmf/rmf/humble-image/rmf.repos
colcon-defaults: |
{
"build": {
"mixin": ["coverage-gcc", "lld"]
}
}
colcon-mixin-repository: https://raw.githubusercontent.com/colcon/colcon-mixin-repository/master/index.yaml
- name: Upload failed test results
uses: actions/upload-artifact@v2
if: failure()
with:
name: test-results
path: ros_ws/build/*/test_results/*/*.catch2.xml
- name: Upload coverage to Codecov
uses: codecov/codecov-action@v1
with:
Expand Down
24 changes: 24 additions & 0 deletions .github/workflows/style.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
name: style
on:
pull_request:
push:
branches: [ main ]
defaults:
run:
shell: bash
jobs:
linter:
runs-on: ubuntu-latest
strategy:
matrix:
docker_image: ['ros:humble-ros-base']
container:
image: ${{ matrix.docker_image }}
steps:
- name: checkout
uses: actions/checkout@v2
- name: uncrustify
run: |
sudo apt update && sudo apt install wget
wget https://raw.githubusercontent.com/open-rmf/rmf_utils/main/rmf_utils/test/format/rmf_code_style.cfg
/ros_entrypoint.sh ament_uncrustify -c rmf_code_style.cfg . --language C++ --exclude rmf_visualization_schedule/include/json.hpp rmf_visualization_schedule/include/jwt/* rmf_visualization_schedule/include/jwt/*/*
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
# rmf_schedule_visualizer

![](https://github.com/open-rmf/rmf_visualization/workflows/build/badge.svg)
![](https://github.com/open-rmf/rmf_visualization/workflows/style/badge.svg)
[![codecov](https://codecov.io/gh/open-rmf/rmf_visualization/branch/main/graph/badge.svg)](https://codecov.io/gh/open-rmf/rmf_visualization)

This repository contains several packages that aid with visualizing various entities within RMF via RViz.
Expand Down
1 change: 1 addition & 0 deletions rmf_visualization_fleet_states/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,7 @@ rclcpp_components_register_node(fleetstates_visualizer
#===============================================================================
if(BUILD_TESTING)
find_package(ament_cmake_uncrustify REQUIRED)
find_package(rmf_utils REQUIRED)
find_file(uncrustify_config_file
NAMES "rmf_code_style.cfg"
PATHS "${rmf_utils_DIR}/../../../share/rmf_utils/")
Expand Down
1 change: 1 addition & 0 deletions rmf_visualization_fleet_states/package.xml
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@

<test_depend>ament_lint_auto</test_depend>
<test_depend>ament_lint_common</test_depend>
<test_depend>rmf_utils</test_depend>

<export>
<build_type>ament_cmake</build_type>
Expand Down
132 changes: 66 additions & 66 deletions rmf_visualization_fleet_states/src/FleetStatesVisualizer.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -67,76 +67,76 @@ FleetStatesVisualizer::FleetStatesVisualizer(const rclcpp::NodeOptions& options)
using Location = rmf_fleet_msgs::msg::Location;

auto set_body_pose =
[](const Location& loc, Marker& marker)
{
marker.pose.position.x = loc.x;
marker.pose.position.y = loc.y;
marker.pose.position.z = 0.0;
marker.pose.orientation.w = 1.0;
};
[](const Location& loc, Marker& marker)
{
marker.pose.position.x = loc.x;
marker.pose.position.y = loc.y;
marker.pose.position.z = 0.0;
marker.pose.orientation.w = 1.0;
};

auto set_nose_pose =
[](const Location& loc, const double radius, Marker& marker)
{
marker.pose.position.x = loc.x + radius * std::cos(loc.yaw);
marker.pose.position.y = loc.y + radius * std::sin(loc.yaw);
marker.pose.position.z = 0.0;
marker.pose.orientation.w = 1.0;
};
[](const Location& loc, const double radius, Marker& marker)
{
marker.pose.position.x = loc.x + radius * std::cos(loc.yaw);
marker.pose.position.y = loc.y + radius * std::sin(loc.yaw);
marker.pose.position.z = 0.0;
marker.pose.orientation.w = 1.0;
};
auto set_text_pose =
[](const Location& loc, const double radius, Marker& marker)
{
marker.pose.position.x =
loc.x + 2.0 * radius * std::cos(loc.yaw - 0.7853);
marker.pose.position.y =
loc.y + 2.0 * radius * std::sin(loc.yaw - 0.7853);
marker.pose.position.z = 0.0;
marker.pose.orientation.w = 1.0;
};
[](const Location& loc, const double radius, Marker& marker)
{
marker.pose.position.x =
loc.x + 2.0 * radius * std::cos(loc.yaw - 0.7853);
marker.pose.position.y =
loc.y + 2.0 * radius * std::sin(loc.yaw - 0.7853);
marker.pose.position.z = 0.0;
marker.pose.orientation.w = 1.0;
};
auto fill_markers =
[&](
const RobotState& state,
const double radius,
const std::size_t id,
MarkerArray& marker_array)
{
const auto& loc = state.location;

Marker body_marker;
body_marker.header.frame_id = "map";
body_marker.header.stamp = state.location.t;
body_marker.ns = "body";
body_marker.id = id;
body_marker.type = body_marker.SPHERE;
body_marker.action = body_marker.MODIFY;
set_body_pose(loc, body_marker);
body_marker.scale.x = 2.0 * radius;
body_marker.scale.y = 2.0 * radius;
body_marker.scale.z = 2.0 * radius;
// TODO(YV): Get the color to match that of the navigation graph
body_marker.color.r = 1.0;
body_marker.color.b = 1.0;
body_marker.color.a = 1.0;
body_marker.lifetime = rclcpp::Duration(std::chrono::seconds(1));

auto nose_marker = body_marker;
nose_marker.ns = "nose";
set_nose_pose(loc, radius, nose_marker);
nose_marker.scale.x = this->_nose_scale * radius;
nose_marker.scale.y = this->_nose_scale * radius;
nose_marker.scale.z = this->_nose_scale * radius;

auto text_marker = body_marker;
text_marker.ns = "name";
text_marker.type = text_marker.TEXT_VIEW_FACING;
set_text_pose(loc, radius, text_marker);
text_marker.text = state.name;
text_marker.scale.z = 0.3;

marker_array.markers.push_back(std::move(body_marker));
marker_array.markers.push_back(std::move(nose_marker));
marker_array.markers.push_back(std::move(text_marker));
};
[&](
const RobotState& state,
const double radius,
const std::size_t id,
MarkerArray& marker_array)
{
const auto& loc = state.location;

Marker body_marker;
body_marker.header.frame_id = "map";
body_marker.header.stamp = state.location.t;
body_marker.ns = "body";
body_marker.id = id;
body_marker.type = body_marker.SPHERE;
body_marker.action = body_marker.MODIFY;
set_body_pose(loc, body_marker);
body_marker.scale.x = 2.0 * radius;
body_marker.scale.y = 2.0 * radius;
body_marker.scale.z = 2.0 * radius;
// TODO(YV): Get the color to match that of the navigation graph
body_marker.color.r = 1.0;
body_marker.color.b = 1.0;
body_marker.color.a = 1.0;
body_marker.lifetime = rclcpp::Duration(std::chrono::seconds(1));

auto nose_marker = body_marker;
nose_marker.ns = "nose";
set_nose_pose(loc, radius, nose_marker);
nose_marker.scale.x = this->_nose_scale * radius;
nose_marker.scale.y = this->_nose_scale * radius;
nose_marker.scale.z = this->_nose_scale * radius;

auto text_marker = body_marker;
text_marker.ns = "name";
text_marker.type = text_marker.TEXT_VIEW_FACING;
set_text_pose(loc, radius, text_marker);
text_marker.text = state.name;
text_marker.scale.z = 0.3;

marker_array.markers.push_back(std::move(body_marker));
marker_array.markers.push_back(std::move(nose_marker));
marker_array.markers.push_back(std::move(text_marker));
};

if (msg->name.empty() || msg->robots.empty())
return;
Expand Down
1 change: 1 addition & 0 deletions rmf_visualization_floorplans/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,7 @@ rclcpp_components_register_node(floorplan_visualizer
#===============================================================================
if(BUILD_TESTING)
find_package(ament_cmake_uncrustify REQUIRED)
find_package(rmf_utils REQUIRED)
find_file(uncrustify_config_file
NAMES "rmf_code_style.cfg"
PATHS "${rmf_utils_DIR}/../../../share/rmf_utils/")
Expand Down
1 change: 1 addition & 0 deletions rmf_visualization_floorplans/package.xml
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@

<test_depend>ament_lint_auto</test_depend>
<test_depend>ament_lint_common</test_depend>
<test_depend>rmf_utils</test_depend>

<export>
<build_type>ament_cmake</build_type>
Expand Down
1 change: 1 addition & 0 deletions rmf_visualization_navgraphs/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,7 @@ rclcpp_components_register_node(navgraph_visualizer
#===============================================================================
if(BUILD_TESTING)
find_package(ament_cmake_uncrustify REQUIRED)
find_package(rmf_utils REQUIRED)
find_file(uncrustify_config_file
NAMES "rmf_code_style.cfg"
PATHS "${rmf_utils_DIR}/../../../share/rmf_utils/")
Expand Down
1 change: 1 addition & 0 deletions rmf_visualization_navgraphs/package.xml
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@

<test_depend>ament_lint_auto</test_depend>
<test_depend>ament_lint_common</test_depend>
<test_depend>rmf_utils</test_depend>

<export>
<build_type>ament_cmake</build_type>
Expand Down
2 changes: 2 additions & 0 deletions rmf_visualization_navgraphs/src/NavGraphVisualizer.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -203,7 +203,9 @@ auto NavGraphVisualizer::FleetNavGraph::update_lane_states(
std::optional<std::string> map_name_filter) -> std::vector<Marker::ConstSharedPtr>
{
if (!traffic_graph.has_value())
{
return {};
}

// TODO(YV): Avoid this copy by storing Maker::ConstSharedPtr in the cache
std::vector<Marker::ConstSharedPtr> marker_updates = {};
Expand Down
3 changes: 2 additions & 1 deletion rmf_visualization_obstacles/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -49,12 +49,13 @@ rclcpp_components_register_node(obstacle_visualizer
#===============================================================================
if(BUILD_TESTING)
find_package(ament_cmake_uncrustify REQUIRED)
find_package(rmf_utils REQUIRED)
find_file(uncrustify_config_file
NAMES "rmf_code_style.cfg"
PATHS "${rmf_utils_DIR}/../../../share/rmf_utils/")

ament_uncrustify(
include/rmf_visualization_schedule src test
ARGN src
CONFIG_FILE ${uncrustify_config_file}
MAX_LINE_LENGTH 80
)
Expand Down
1 change: 1 addition & 0 deletions rmf_visualization_obstacles/package.xml
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@
<depend>rmf_visualization_msgs</depend>

<test_depend>ament_cmake_uncrustify</test_depend>
<test_depend>rmf_utils</test_depend>

<export>
<build_type>ament_cmake</build_type>
Expand Down
3 changes: 2 additions & 1 deletion rmf_visualization_rviz2_plugins/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -35,12 +35,13 @@ find_package(Qt5 REQUIRED COMPONENTS Widgets Test)

if(BUILD_TESTING)
find_package(ament_cmake_uncrustify REQUIRED)
find_package(rmf_utils REQUIRED)
find_file(uncrustify_config_file
NAMES "rmf_code_style.cfg"
PATHS "${rmf_utils_DIR}/../../../share/rmf_utils/")

ament_uncrustify(
src test
ARGN src
CONFIG_FILE ${uncrustify_config_file}
MAX_LINE_LENGTH 80
)
Expand Down
1 change: 1 addition & 0 deletions rmf_visualization_rviz2_plugins/package.xml
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@
<exec_depend>libqt5-widgets</exec_depend>

<test_depend>ament_cmake_uncrustify</test_depend>
<test_depend>rmf_utils</test_depend>

<export>
<build_type>ament_cmake</build_type>
Expand Down
3 changes: 2 additions & 1 deletion rmf_visualization_schedule/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -32,12 +32,13 @@ find_package(Threads)

if(BUILD_TESTING)
find_package(ament_cmake_uncrustify REQUIRED)
find_package(rmf_utils REQUIRED)
find_file(uncrustify_config_file
NAMES "rmf_code_style.cfg"
PATHS "${rmf_utils_DIR}/../../../share/rmf_utils/")

ament_uncrustify(
include/rmf_visualization_schedule src test
ARGN include/rmf_visualization_schedule src test
CONFIG_FILE ${uncrustify_config_file}
MAX_LINE_LENGTH 80
)
Expand Down
1 change: 1 addition & 0 deletions rmf_visualization_schedule/package.xml
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@
<test_depend>ament_lint_auto</test_depend>
<test_depend>ament_lint_common</test_depend>
<test_depend>ament_cmake_uncrustify</test_depend>
<test_depend>rmf_utils</test_depend>

<member_of_group>rosidl_interface_packages</member_of_group>

Expand Down