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

Feature/geojson graph #142

Merged
merged 31 commits into from
Feb 13, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
31 commits
Select commit Hold shift + click to select a range
89e90d2
Add functions to convert Graph between rmf_building_maps and rmf_traffic
luca-della-vedova Sep 10, 2021
5acad92
Add unit tests, fix reference
luca-della-vedova Sep 14, 2021
0fd8f1f
Add dock event
luca-della-vedova Sep 14, 2021
1fbfe5d
Fix docking logic
luca-della-vedova Sep 20, 2021
84a76dd
Add lane speed limit
luca-della-vedova Sep 21, 2021
63e21ae
WIP towards geopackage graph parsing
luca-della-vedova Oct 6, 2021
484c8a6
Remove debug printouts
luca-della-vedova Oct 6, 2021
745e307
Add json dependency
luca-della-vedova Oct 11, 2021
aa7d107
Parse graph_idx and speed_limit
luca-della-vedova Oct 11, 2021
0554890
Remove debug exit()
luca-della-vedova Oct 12, 2021
5fc0808
Fix graph_idx skipping logic
luca-della-vedova Nov 8, 2021
c2f1d68
Delete tmp file on conversion done
luca-della-vedova Nov 10, 2021
1956e85
Add bidirectional edges and docking
luca-della-vedova Nov 10, 2021
deb55b6
WIP geojson
codebot Nov 18, 2021
314446a
WIP geojson and geojson.gz
codebot Nov 19, 2021
ee515cc
WIP parsing lanes from GeoJSON
codebot Nov 19, 2021
c534294
Merge remote-tracking branch 'origin/main' into feature/geojson_graph
codebot Nov 21, 2021
d792d5d
uncrustify
codebot Nov 21, 2021
5070919
uncrustify
codebot Nov 22, 2021
efd773d
Minor cleanups and refactors
luca-della-vedova Nov 23, 2021
ba5aac9
Uncrustify
luca-della-vedova Nov 23, 2021
245baea
use rmf_ prefix for RMF feature types
codebot Dec 1, 2021
5d916a2
Merge branch 'feature/geojson_graph' of https://github.com/open-rmf/r…
codebot Dec 1, 2021
6f53bec
Merge branch 'main' into feature/geojson_graph
luca-della-vedova Jan 3, 2022
06fa197
Merge branch 'main' into feature/geojson_graph
luca-della-vedova Feb 9, 2022
1ad0c4b
Fix cmake config script
mxgrey Feb 11, 2022
75124bf
Leave a note about bringing tests back
mxgrey Feb 11, 2022
0bb350b
Export all dependencies
mxgrey Feb 12, 2022
5b85a9c
Skip Python tests on CI until the configuration can be fixed
mxgrey Feb 12, 2022
6b5883f
Increase test time threshold
mxgrey Feb 12, 2022
1453302
Add unit tests for geojson map parsing functions (#144)
luca-della-vedova Feb 12, 2022
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
2 changes: 1 addition & 1 deletion .github/workflows/build.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ jobs:
rmf_traffic_ros2
rmf_task_ros2
rmf_fleet_adapter
rmf_fleet_adapter_python
# rmf_fleet_adapter_python # TODO(MXG): These tests are failing in the CI, and it seems to be related to https://github.com/ros2/launch/pull/592. Figure out how to fix this.
vcs-repo-file-url: |
https://raw.githubusercontent.com/open-rmf/rmf/main/rmf.repos
colcon-defaults: |
Expand Down
12 changes: 6 additions & 6 deletions rmf_fleet_adapter/test/phases/test_DoorClose.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -191,7 +191,7 @@ SCENARIO_METHOD(MockAdapterFixture, "door close phase", "[phases]")
AND_WHEN("door state is closed and supervisor do not have session")
{
rmf_rxcpp::subscription_guard sub2 =
rxcpp::observable<>::interval(std::chrono::milliseconds(1))
rxcpp::observable<>::interval(std::chrono::milliseconds(10))
.subscribe_on(rxcpp::observe_on_new_thread())
.subscribe(
[publish_door_state, publish_empty_heartbeat](const auto&)
Expand All @@ -204,7 +204,7 @@ SCENARIO_METHOD(MockAdapterFixture, "door close phase", "[phases]")
{
std::unique_lock<std::mutex> lk(test->m);
bool completed = test->status_updates_cv.wait_for(
lk, std::chrono::milliseconds(10),
lk, std::chrono::milliseconds(100),
[test]()
{
return test->last_state_value() == Task::StatusMsg::STATE_COMPLETED;
Expand All @@ -216,7 +216,7 @@ SCENARIO_METHOD(MockAdapterFixture, "door close phase", "[phases]")
AND_WHEN("door state is open and supervisor do not have session")
{
rmf_rxcpp::subscription_guard sub2 =
rxcpp::observable<>::interval(std::chrono::milliseconds(1))
rxcpp::observable<>::interval(std::chrono::milliseconds(10))
.subscribe_on(rxcpp::observe_on_new_thread())
.subscribe([publish_door_state, publish_empty_heartbeat](const auto&)
{
Expand All @@ -228,7 +228,7 @@ SCENARIO_METHOD(MockAdapterFixture, "door close phase", "[phases]")
{
std::unique_lock<std::mutex> lk(test->m);
bool completed = test->status_updates_cv.wait_for(
lk, std::chrono::milliseconds(10), [test]()
lk, std::chrono::milliseconds(100), [test]()
{
return test->last_state_value() == Task::StatusMsg::STATE_COMPLETED;
});
Expand All @@ -252,7 +252,7 @@ SCENARIO_METHOD(MockAdapterFixture, "door close phase", "[phases]")
{
std::unique_lock<std::mutex> lk(test->m);
bool completed = test->status_updates_cv.wait_for(
lk, std::chrono::milliseconds(10), [test]()
lk, std::chrono::milliseconds(100), [test]()
{
return test->last_state_value() == Task::StatusMsg::STATE_COMPLETED;
});
Expand All @@ -267,7 +267,7 @@ SCENARIO_METHOD(MockAdapterFixture, "door close phase", "[phases]")

bool completed =
test->status_updates_cv.wait_for(
lk, std::chrono::milliseconds(10), [test]()
lk, std::chrono::milliseconds(100), [test]()
{
for (const auto& status : test->status_updates)
{
Expand Down
12 changes: 6 additions & 6 deletions rmf_fleet_adapter/test/phases/test_DoorOpen.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -210,7 +210,7 @@ SCENARIO_METHOD(MockAdapterFixture, "door open phase", "[phases]")
AND_WHEN("door state is open and supervisor has session")
{
rmf_rxcpp::subscription_guard sub2 =
rxcpp::observable<>::interval(std::chrono::milliseconds(1))
rxcpp::observable<>::interval(std::chrono::milliseconds(10))
.subscribe_on(rxcpp::observe_on_new_thread())
.subscribe(
[publish_door_state, publish_heartbeat_with_session](const auto&)
Expand All @@ -223,7 +223,7 @@ SCENARIO_METHOD(MockAdapterFixture, "door open phase", "[phases]")
{
std::unique_lock<std::mutex> lk(test->m);
bool completed = test->status_updates_cv.wait_for(
lk, std::chrono::milliseconds(10),
lk, std::chrono::milliseconds(100),
[test]()
{
return test->last_state_value() == Task::StatusMsg::STATE_COMPLETED;
Expand All @@ -235,7 +235,7 @@ SCENARIO_METHOD(MockAdapterFixture, "door open phase", "[phases]")
AND_WHEN("door state is open and supervisor do not have session")
{
rmf_rxcpp::subscription_guard sub2 =
rxcpp::observable<>::interval(std::chrono::milliseconds(1))
rxcpp::observable<>::interval(std::chrono::milliseconds(10))
.subscribe_on(rxcpp::observe_on_new_thread())
.subscribe([publish_door_state, publish_empty_heartbeat](const auto&)
{
Expand All @@ -247,7 +247,7 @@ SCENARIO_METHOD(MockAdapterFixture, "door open phase", "[phases]")
{
std::unique_lock<std::mutex> lk(test->m);
bool completed = test->status_updates_cv.wait_for(
lk, std::chrono::milliseconds(10),
lk, std::chrono::milliseconds(100),
[test]()
{
return test->last_state_value() == Task::StatusMsg::STATE_COMPLETED;
Expand All @@ -259,7 +259,7 @@ SCENARIO_METHOD(MockAdapterFixture, "door open phase", "[phases]")
AND_WHEN("door state is closed and supervisor has session")
{
rmf_rxcpp::subscription_guard sub2 =
rxcpp::observable<>::interval(std::chrono::milliseconds(1))
rxcpp::observable<>::interval(std::chrono::milliseconds(10))
.subscribe_on(rxcpp::observe_on_new_thread())
.subscribe([publish_door_state, publish_empty_heartbeat](const auto&)
{
Expand All @@ -271,7 +271,7 @@ SCENARIO_METHOD(MockAdapterFixture, "door open phase", "[phases]")
{
std::unique_lock<std::mutex> lk(test->m);
bool completed = test->status_updates_cv.wait_for(
lk, std::chrono::milliseconds(10),
lk, std::chrono::milliseconds(100),
[test]()
{
return test->last_state_value() == Task::StatusMsg::STATE_COMPLETED;
Expand Down
28 changes: 26 additions & 2 deletions rmf_traffic_ros2/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
cmake_minimum_required(VERSION 3.5)
cmake_minimum_required(VERSION 3.14)

project(rmf_traffic_ros2)

Expand All @@ -16,10 +16,19 @@ include(GNUInstallDirs)
find_package(ament_cmake REQUIRED)
find_package(rmf_traffic REQUIRED)
find_package(rmf_traffic_msgs REQUIRED)
find_package(rmf_site_map_msgs REQUIRED)
find_package(rmf_fleet_msgs REQUIRED)
find_package(Eigen3 REQUIRED)
find_package(rclcpp REQUIRED)
find_package(yaml-cpp REQUIRED)
find_package(nlohmann_json REQUIRED)
find_package(ZLIB REQUIRED)

# NOTE(MXG): libproj-dev does not currently distribute its cmake config-files
# in Debian, so we can't use find_package and need to rely on pkg-config.
# find_package(PROJ REQUIRED)
find_package(PkgConfig REQUIRED)
pkg_check_modules(PROJ REQUIRED IMPORTED_TARGET proj)

if (rmf_traffic_FOUND)
message(STATUS "found rmf_traffic")
Expand All @@ -46,6 +55,10 @@ if(BUILD_TESTING)
test_rmf_traffic_ros2 test/main.cpp ${unit_test_srcs}
TIMEOUT 300)

target_compile_definitions(test_rmf_traffic_ros2
PRIVATE
"-DTEST_RESOURCES_DIR=\"${CMAKE_CURRENT_SOURCE_DIR}/test/resources/\"")

target_link_libraries(test_rmf_traffic_ros2
rmf_traffic_ros2
yaml-cpp
Expand Down Expand Up @@ -154,16 +167,21 @@ add_library(rmf_traffic_ros2 SHARED ${core_lib_srcs})
target_link_libraries(rmf_traffic_ros2
PUBLIC
rmf_traffic::rmf_traffic
nlohmann_json::nlohmann_json
${rmf_traffic_msgs_LIBRARIES}
${rmf_site_map_msgs_LIBRARIES}
${rclcpp_LIBRARIES}
yaml-cpp
ZLIB::ZLIB
PkgConfig::PROJ
)

target_include_directories(rmf_traffic_ros2
PUBLIC
$<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}/include>
$<INSTALL_INTERFACE:${CMAKE_INSTALL_INCLUDEDIR}>
${rmf_traffic_msgs_INCLUDE_DIRS}
${rmf_site_map_msgs_INCLUDE_DIRS}
${rclcpp_INCLUDE_DIRS}
)

Expand All @@ -173,9 +191,12 @@ ament_export_dependencies(
rmf_traffic
rmf_traffic_msgs
rmf_fleet_msgs
rmf_site_map_msgs
Eigen3
rclcpp
yaml-cpp
nlohmann_json
ZLIB
)

# TODO(MXG): Change these executables into shared libraries that can act as
Expand Down Expand Up @@ -237,4 +258,7 @@ install(
ARCHIVE DESTINATION lib
)

ament_package()
ament_package(
CONFIG_EXTRAS
cmake/proj_dependency.cmake
)
2 changes: 2 additions & 0 deletions rmf_traffic_ros2/cmake/proj_dependency.cmake
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
find_package(PkgConfig REQUIRED)
pkg_check_modules(PROJ REQUIRED IMPORTED_TARGET proj)
28 changes: 28 additions & 0 deletions rmf_traffic_ros2/include/rmf_traffic_ros2/agv/Graph.hpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
/*
* Copyright (C) 2021 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.
*
*/

#include <rmf_traffic/agv/Graph.hpp>

#include <rmf_site_map_msgs/msg/site_map.hpp>

namespace rmf_traffic_ros2 {

//==============================================================================
rmf_traffic::agv::Graph convert(const rmf_site_map_msgs::msg::SiteMap& from,
int graph_idx = 0, double wp_tolerance = 1e-3);
codebot marked this conversation as resolved.
Show resolved Hide resolved

} // namespace rmf_traffic_ros2
4 changes: 4 additions & 0 deletions rmf_traffic_ros2/package.xml
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,12 @@
<depend>rmf_traffic</depend>
<depend>rmf_traffic_msgs</depend>
<depend>rmf_fleet_msgs</depend>
<depend>rmf_site_map_msgs</depend>
<depend>rclcpp</depend>
<depend>yaml-cpp</depend>
<depend>nlohmann-json-dev</depend>
<depend>proj</depend>
<depend>zlib</depend>

<build_depend>eigen</build_depend>

Expand Down
Loading