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

rmf_obstacle_ros2 #210

Merged
merged 74 commits into from
Mar 18, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
74 commits
Select commit Hold shift + click to select a range
818ddd8
Publish nav graph
Yadunund May 11, 2022
f337d67
Added ObstacleManager
Yadunund May 12, 2022
4a9a092
Merge branch 'main' into feature/publish_nav_graph
Yadunund May 13, 2022
7447de9
Moved ObstacleManager into src
Yadunund May 16, 2022
05aee96
Build as ROS 2 component. Dynamically load detector and responder plu…
Yadunund May 16, 2022
ced9304
Refactor into data struct
Yadunund May 16, 2022
8ec7d88
Uncrustify
Yadunund May 16, 2022
89a2088
Serialize using octomap
Yadunund May 19, 2022
7f02d18
Removed ObstacleData
Yadunund May 23, 2022
9844a57
Merge branch 'main' into feature/publish_nav_graph
Yadunund Jun 2, 2022
00dc6a1
Detector accepts a callback
Yadunund Jun 2, 2022
dd94cde
Export dependencies
Yadunund Jun 2, 2022
6425b22
Export include dir
Yadunund Jun 2, 2022
914cffc
Explicitly link pluginlib
Yadunund Jun 2, 2022
9cb6556
Keep ClassLoaders alive
Yadunund Jun 2, 2022
ed1fd4f
Revert to msg builder API
Yadunund Jun 6, 2022
ad9ee11
Explicitly include message headers
Yadunund Jun 6, 2022
9de2e00
Add skeleton for LaneBlocker
Yadunund Jun 9, 2022
77adb9b
Merge branch 'feature/publish_nav_graph' into feature/rmf_obstacle
Yadunund Jun 9, 2022
81dffba
Use api from rmf_traffic_ros2 for graph serialization
Yadunund Jun 22, 2022
e88eb73
Fix typo
Yadunund Jun 22, 2022
e7f27ea
Merge branch 'main' into feature/publish_nav_graph
Yadunund Jun 22, 2022
eaa61df
Uncrustify
Yadunund Jun 23, 2022
a13c2ce
Merge branch 'feature/publish_nav_graph' into feature/rmf_obstacle
Yadunund Jun 23, 2022
4e9bee7
Implement speed limit API and publish lane_states
Yadunund Jun 28, 2022
2e14cb4
Added speed limit request interface to legacy full_control
Yadunund Jun 28, 2022
a43540f
Uncrustify
Yadunund Jun 28, 2022
d1438bc
Merge lane states pub
Yadunund Jun 29, 2022
5311716
Compute transfroms to rmf frame
Yadunund Jun 29, 2022
4681128
Added skeletop for processing
Yadunund Jun 30, 2022
06366c5
Warn users of unsupported speed limits
Yadunund Jul 1, 2022
247e019
Serialize/deserialize speed limits
Yadunund Jul 1, 2022
399d4ae
Merge branch 'feature/publish_nav_graph' into feature/rmf_obstacle
Yadunund Jul 1, 2022
069d52c
Merge branch 'feature/speed_limits_and_lane_states' into feature/rmf_…
Yadunund Jul 1, 2022
f2de323
Merge branch 'feature/rmf_obstacle' into feature/lane_blocker
Yadunund Jul 1, 2022
19ba11c
Added logic for publishing lane closures
Yadunund Jul 1, 2022
8d9101d
Add cull timer
Yadunund Jul 1, 2022
560abe5
Finished implementing cull
Yadunund Jul 1, 2022
64a27fd
Updated intersection checker
Yadunund Jul 4, 2022
8f43431
WIP
Yadunund Jul 5, 2022
32cc461
Fix tf2_geometry_msgs dep for humble
Yadunund Jul 5, 2022
9ebf8a9
Merge branch 'feature/rmf_obstacle' into feature/lane_blocker
Yadunund Jul 5, 2022
0897548
Rough collision check implementation
Yadunund Jul 5, 2022
d60ca5f
Added tests for IntersectionChecker
Yadunund Jul 6, 2022
8738be3
Fixes to SAT
Yadunund Jul 6, 2022
a4315a4
Debug rotation
Yadunund Jul 7, 2022
14ec46b
Kinda working
Yadunund Jul 13, 2022
a87b5b8
Use lowest not min
Yadunund Jul 13, 2022
4157342
Added more failing tests
Yadunund Jul 13, 2022
f1e4d94
Use dist
Yadunund Jul 13, 2022
a87b5b1
Cleanup
Yadunund Jul 14, 2022
4280b89
Many logic fixes
Yadunund Jul 14, 2022
22ee0e7
Uncrustify
Yadunund Jul 14, 2022
992af12
Refactor
Yadunund Jul 15, 2022
7b39014
Fix API and use bb msgs from rmf_obstacle_ros2
Yadunund Jul 21, 2022
324d4b4
Simplify pkg
Yadunund Jul 29, 2022
34c9c9e
Fix rmf_obstacle_ros2 intersection checker (#219)
PranayShirodkar Aug 3, 2022
4212cfc
Use local bb2d
Yadunund Aug 26, 2022
16bffd1
Fix merge conflicts
Yadunund Nov 10, 2022
5885715
Uncrustify
Yadunund Nov 10, 2022
b36c218
Merge branch 'main' into feature/rmf_obstacle
ahcorde Nov 14, 2022
ddf188e
Added feeback
ahcorde Nov 18, 2022
49b5e6e
Add Speed Limit Requests (#222)
PranayShirodkar Nov 22, 2022
5f1305a
Filled PointCloud message
ahcorde Nov 24, 2022
9bc9770
Insert lanes with their state
ahcorde Nov 24, 2022
06f3da1
Added MessageFilter to rmf_obstacles topic
ahcorde Nov 25, 2022
eaf094b
Added optional return value to deserialize_key method
ahcorde Nov 25, 2022
02d4b0c
Combine close/open and limit/unlimit functions
ahcorde Nov 25, 2022
3f7dc6e
Use member variables instead of passing unordered_maps by reference …
ahcorde Nov 25, 2022
382b3cc
Defined templated pure abstract class to perform serialization/deseri…
ahcorde Nov 25, 2022
a11ee42
Resolve merge conflicts with main
Yadunund Mar 16, 2024
4480115
Fix build
Yadunund Mar 16, 2024
ef4909c
Merge branch 'main' into feature/rmf_obstacle
Yadunund Mar 18, 2024
fc0d9e3
Link against targets in test
Yadunund Mar 18, 2024
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
145 changes: 145 additions & 0 deletions rmf_obstacle_ros2/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,145 @@
cmake_minimum_required(VERSION 3.8)
project(rmf_obstacle_ros2)

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

include(GNUInstallDirs)

find_package(ament_cmake REQUIRED)

set(dep_pkgs
geometry_msgs
rclcpp
rclcpp_components
rmf_utils
rmf_obstacle_msgs
rmf_fleet_msgs
rmf_building_map_msgs
sensor_msgs
OCTOMAP
rmf_fleet_adapter
rmf_traffic
rmf_traffic_ros2
tf2_ros
tf2_geometry_msgs
)
foreach(pkg ${dep_pkgs})
find_package(${pkg} REQUIRED)
endforeach()

#===============================================================================
file(GLOB_RECURSE core_lib_srcs "src/rmf_obstacle_ros2/*.cpp")
add_library(rmf_obstacle_ros2 SHARED ${core_lib_srcs})

target_link_libraries(rmf_obstacle_ros2
PUBLIC
rmf_utils::rmf_utils
${rclcpp_TARGETS}
${sensor_msgs_TARGETS}
${rmf_obstacle_msgs_TARGETS}
PRIVATE
${OCTOMAP_TARGETS}
)

target_include_directories(rmf_obstacle_ros2
PUBLIC
$<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}/include>
$<INSTALL_INTERFACE:${CMAKE_INSTALL_INCLUDEDIR}>
${rclcpp_INCLUDE_DIRS}
${sensor_msgs_INCLUDE_DIRS}
${rmf_obstacle_msgs_INCLUDE_DIRS}
PRIVATE
${OCTOMAP_INCLUDE_DIRS}
)

target_compile_features(rmf_obstacle_ros2 INTERFACE cxx_std_17)

ament_export_targets(rmf_obstacle_ros2 HAS_LIBRARY_TARGET)

ament_export_dependencies(${dep_pkgs})

ament_export_include_directories(
include
)

#===============================================================================
file(GLOB_RECURSE lane_blocker_srcs
"src/lane_blocker/*.cpp"
)
add_library(lane_blocker SHARED ${lane_blocker_srcs})

target_link_libraries(lane_blocker
PRIVATE
rclcpp::rclcpp
${rclcpp_components_TARGETS}
${rmf_obstacle_msgs_TARGETS}
${rmf_fleet_msgs_TARGETS}
${rmf_building_map_msgs_TARGETS}
rmf_fleet_adapter::rmf_fleet_adapter
rmf_traffic::rmf_traffic
${rmf_traffic_ros2_TARGETS}
${tf2_ros_TARGETS}
${geometry_msgs_TARGETS}
tf2_geometry_msgs::tf2_geometry_msgs
)

target_include_directories(lane_blocker
PRIVATE
$<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}/include>
$<INSTALL_INTERFACE:${CMAKE_INSTALL_INCLUDEDIR}>
${rclcpp_INCLUDE_DIRS}
${rclcpp_components_INCLUDE_DIRS}
${rmf_obstacle_msgs_INCLUDE_DIRS}
${rmf_fleet_msgs_INCLUDE_DIRS}
${rmf_building_map_msgs_INCLUDE_DIRS}
${rmf_fleet_adapter_INCLUDE_DIRS}
${rmf_traffic_INCLUDE_DIRS}
${rmf_traffic_ros2_INCLUDE_DIRS}
${tf2_ros_INCLUDE_DIRS}
${geometry_msgs_INCLUDE_DIRS}
${tf2_geometry_msgs_include_dirs}
)

target_compile_features(lane_blocker INTERFACE cxx_std_17)

rclcpp_components_register_node(lane_blocker
PLUGIN "LaneBlocker"
EXECUTABLE lane_blocker_node)

#===============================================================================
if(BUILD_TESTING)
find_package(ament_cmake_uncrustify REQUIRED)
find_package(ament_cmake_catch2 REQUIRED)

find_file(uncrustify_config_file
NAMES "rmf_code_style.cfg"
PATHS "${rmf_utils_DIR}/../../../share/rmf_utils/")

ament_uncrustify(
ARGN include src
CONFIG_FILE ${uncrustify_config_file}
MAX_LINE_LENGTH 80
)

add_subdirectory(src/lane_blocker/test)
endif()

#===============================================================================
install(
DIRECTORY include/
DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}
)

install(
TARGETS
rmf_obstacle_ros2
lane_blocker
EXPORT rmf_obstacle_ros2
RUNTIME DESTINATION lib/rmf_obstacle_ros2
LIBRARY DESTINATION lib
ARCHIVE DESTINATION lib
)

ament_package()
29 changes: 29 additions & 0 deletions rmf_obstacle_ros2/include/rmf_obstacle_ros2/StandardNames.hpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
/*
* Copyright (C) 2022 Open Source Robotics Foundation
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*
*/

#ifndef RMF_OBSTACLE_ROS2__STANDARDNAMES_HPP
#define RMF_OBSTACLE_ROS2__STANDARDNAMES_HPP

#include <string>

namespace rmf_obstacle_ros2 {

const std::string ObstacleTopicName = "rmf_obstacles";

} // namespace rmf_obstacle_ros2

#endif // RMF_OBSTACLE_ROS2__STANDARDNAMES_HPP
23 changes: 23 additions & 0 deletions rmf_obstacle_ros2/include/rmf_obstacle_ros2/obstacles/Convert.hpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
/*
* Copyright (C) 2022 Open Source Robotics Foundation
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*
*/

#ifndef RMF_OBSTACLE_ROS2__OBSTACLES__CONVERT_HPP
#define RMF_OBSTACLE_ROS2__OBSTACLES__CONVERT_HPP

#include <rmf_obstacle_ros2/obstacles/convert/ConvertPointCloudObstacles.hpp>

#endif // RMF_OBSTACLE_ROS2__OBSTACLES__CONVERT_HPP
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
// Copyright 2022 Open Source Robotics Foundation, Inc.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.

#ifndef RMF_OBSTACLE_ROS2__OBSTACLES__CONVERTDECL_HPP
#define RMF_OBSTACLE_ROS2__OBSTACLES__CONVERTDECL_HPP

namespace rmf_obstacle_ros2 {
using Obstacle = rmf_obstacle_msgs::msg::Obstacle;

//==============================================================================
/// Serialize a SensorMsg into RMF Obstacle msg
template<typename SensorMsg>
void fill_obstacle_data(const SensorMsg& msg, Obstacle& obstacle);

//==============================================================================
/// Convert an RMF Obstacle msg into a SensorMsg type
template<typename SensorMsg>
SensorMsg convert(const Obstacle& msg);
} // namespace ros_gz_bridge

#endif // #indef RMF_OBSTACLE_ROS2__OBSTACLES__CONVERTDECL_HPP
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
/*
* Copyright (C) 2022 Open Source Robotics Foundation
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*
*/

#ifndef RMF_OBSTACLE_ROS2__OBSTACLES__CONVERT__CONVERTPOINTCLOUDOBSTACLES_HPP
#define RMF_OBSTACLE_ROS2__OBSTACLES__CONVERT__CONVERTPOINTCLOUDOBSTACLES_HPP

#include <rmf_obstacle_msgs/msg/obstacle.hpp>
#include <sensor_msgs/msg/point_cloud2.hpp>
#include "rmf_obstacle_ros2/obstacles/ConvertDecl.hpp"

namespace rmf_obstacle_ros2 {

using PointCloud = sensor_msgs::msg::PointCloud2;

//==============================================================================
/// Serialize a PointCloud2 msg into RMF Obstacle msg
template<>
void fill_obstacle_data(const PointCloud& msg, Obstacle& obstacle);

//==============================================================================
/// Convert an RMF Obstacle msg into a PointCloud2 msg
template<>
PointCloud convert(const Obstacle& msg);
} // namespace rmf_obstacle_ros2

#endif // #indef RMF_OBSTACLE_ROS2__OBSTACLES__CONVERT__CONVERTPOINTCLOUDOBSTACLES_HPP
33 changes: 33 additions & 0 deletions rmf_obstacle_ros2/package.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
<?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>rmf_obstacle_ros2</name>
<version>2.1.0</version>
<description>A package containing utilities for managing obstacles in RMF</description>
<maintainer email="[email protected]">Yadunund</maintainer>
<license>Apache License 2.0</license>

<buildtool_depend>ament_cmake</buildtool_depend>

<depend>geometry_msgs</depend>
<depend>rclcpp</depend>
Yadunund marked this conversation as resolved.
Show resolved Hide resolved
<depend>rclcpp_components</depend>
<depend>rmf_utils</depend>
<depend>rmf_obstacle_msgs</depend>
<depend>rmf_fleet_msgs</depend>
<depend>rmf_building_map_msgs</depend>
<depend>sensor_msgs</depend>
<depend>octomap</depend>
<depend>rmf_fleet_adapter</depend>
<depend>rmf_traffic</depend>
<depend>rmf_traffic_ros2</depend>
<depend>tf2_ros</depend>
<depend>tf2_geometry_msgs</depend>

<test_depend>ament_cmake_catch2</test_depend>
<test_depend>ament_cmake_uncrustify</test_depend>

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