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

Route Tool Rviz Panel #4775

Open
wants to merge 35 commits into
base: nav2_route_server
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
35 commits
Select commit Hold shift + click to select a range
5eaa17a
new image
SteveMacenski Mar 9, 2023
2d8f1ec
tmp push for moving computers
SteveMacenski Nov 30, 2023
de59ae6
turtlebot3 world graph (#3472)
jwallace42 Mar 13, 2023
a4dbb5d
scripts for route (#3490)
jwallace42 Mar 18, 2023
439e488
Patch repo to build from source with Humble (#1)
adamlm Apr 11, 2024
35ff4c7
Fix bad GeoJSON files and shift map (#2)
adamlm Apr 11, 2024
0bded21
added route tool skeleton code and gui
john-chrosniak Jun 20, 2024
c30e5fe
rviz2 panel can load route graph
john-chrosniak Jul 24, 2024
efcd5c1
can add nodes using route tool
john-chrosniak Jul 24, 2024
5c944ce
added logic for creating edges
john-chrosniak Jul 25, 2024
6d2ba07
graph nodes can be edited, existing edges will still connect if a nod…
john-chrosniak Jul 25, 2024
46990ab
can edit edges
john-chrosniak Jul 25, 2024
5640c77
can delete nodes and edges
john-chrosniak Jul 25, 2024
3d8b956
route graphs can be saved
john-chrosniak Aug 7, 2024
ada58f5
fixed bug for loading in route graphs
john-chrosniak Aug 7, 2024
38a3fdb
added dynamic text to UI, created launch file and rviz configuration
john-chrosniak Aug 7, 2024
2935f71
fixed bug for deleting nodes
john-chrosniak Aug 9, 2024
ecf4608
actually fixed node removal bug
john-chrosniak Aug 9, 2024
8ad1b27
publishing clicked point populates x and y fields
john-chrosniak Aug 9, 2024
4e089aa
removed debugging log statements
john-chrosniak Aug 9, 2024
aef4bfc
added check to make sure node/edges exist before editing
john-chrosniak Aug 16, 2024
8d91a7b
bug fix
john-chrosniak Nov 6, 2024
e1e0609
migrated route tool to rviz plugin
john-chrosniak Nov 19, 2024
5f29eb9
minor refactoring
john-chrosniak Nov 19, 2024
69f94d9
added metadata and operations to graph saver so nothing should be erased
john-chrosniak Nov 21, 2024
657ad71
edited set route service to clear current route before setting new
john-chrosniak Aug 12, 2024
d188c46
Update README.md
SaikrishnaBairamoni Sep 24, 2024
447d5d1
addressed comments
john-chrosniak Nov 25, 2024
c78364d
documentation cleanup
john-chrosniak Nov 25, 2024
1fc2af4
changed copyright
john-chrosniak Nov 25, 2024
00e4ab9
addressed comments
john-chrosniak Nov 25, 2024
9b004c9
moved copyright due to compiler error
john-chrosniak Nov 26, 2024
7aeeafb
revert removal of files
john-chrosniak Dec 4, 2024
752caf0
added gen ai comment
john-chrosniak Dec 4, 2024
b154d78
reverted unneeded changes
john-chrosniak Dec 4, 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
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ class BtServiceNode : public BT::ActionNodeBase
getInput("service_name", service_name_);
service_client_ = node_->create_client<ServiceT>(
service_name_,
rclcpp::SystemDefaultsQoS(),
rmw_qos_profile_services_default,
callback_group_);

// Make a request for the service without parameter
Expand Down
19 changes: 19 additions & 0 deletions nav2_bringup/params/nav2_params.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -316,6 +316,25 @@ waypoint_follower:
enabled: True
waypoint_pause_duration: 200

route_server:
ros__parameters:
graph_filepath: "/home/steve/Documents/nav2_ws/src/navigation2/nav2_route/graphs/aws_graph.geojson"
boundary_radius_to_achieve_node: 1.0
radius_to_achieve_node: 2.0
operations: ["AdjustSpeedLimit", "ReroutingService", "CollisionMonitor"]
ReroutingService:
plugin: "nav2_route::ReroutingService"
AdjustSpeedLimit:
plugin: "nav2_route::AdjustSpeedLimit"
CollisionMonitor:
plugin: "nav2_route::CollisionMonitor"
max_collision_dist: 1.0
edge_cost_functions: ["DistanceScorer", "CostmapScorer"]
DistanceScorer:
plugin: "nav2_route::DistanceScorer"
CostmapScorer:
plugin: "nav2_route::CostmapScorer"

velocity_smoother:
ros__parameters:
smoothing_frequency: 20.0
Expand Down
4 changes: 2 additions & 2 deletions nav2_lifecycle_manager/src/lifecycle_manager.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -62,13 +62,13 @@ LifecycleManager::LifecycleManager(const rclcpp::NodeOptions & options)
manager_srv_ = create_service<ManageLifecycleNodes>(
get_name() + std::string("/manage_nodes"),
std::bind(&LifecycleManager::managerCallback, this, _1, _2, _3),
rclcpp::SystemDefaultsQoS(),
rmw_qos_profile_services_default,
callback_group_);

is_active_srv_ = create_service<std_srvs::srv::Trigger>(
get_name() + std::string("/is_active"),
std::bind(&LifecycleManager::isActiveCallback, this, _1, _2, _3),
rclcpp::SystemDefaultsQoS(),
rmw_qos_profile_services_default,
callback_group_);

transition_state_map_[Transition::TRANSITION_CONFIGURE] = State::PRIMARY_STATE_INACTIVE;
Expand Down
13 changes: 11 additions & 2 deletions nav2_route/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,7 @@ add_library(${library_name} SHARED
src/node_spatial_tree.cpp
src/path_converter.cpp
src/graph_loader.cpp
src/graph_saver.cpp
src/goal_intent_extractor.cpp
)

Expand Down Expand Up @@ -109,6 +110,14 @@ ament_target_dependencies(graph_file_loaders
${dependencies}
)

add_library(graph_file_savers SHARED
src/plugins/graph_file_savers/geojson_graph_file_saver.cpp
)

ament_target_dependencies(graph_file_savers
${dependencies}
)

pluginlib_export_plugin_description_file(nav2_route plugins.xml)

install(DIRECTORY include/
Expand All @@ -119,7 +128,7 @@ install(TARGETS ${executable_name}
RUNTIME DESTINATION lib/${PROJECT_NAME}
)

install(TARGETS ${library_name} edge_scorers route_operations graph_file_loaders
install(TARGETS ${library_name} edge_scorers route_operations graph_file_loaders graph_file_savers
ARCHIVE DESTINATION lib
LIBRARY DESTINATION lib
RUNTIME DESTINATION bin
Expand All @@ -138,5 +147,5 @@ endif()

ament_export_include_directories(include)
ament_export_dependencies(${dependencies})
ament_export_libraries(${library_name} edge_scorers route_operations graph_file_loaders)
ament_export_libraries(${library_name} edge_scorers route_operations graph_file_loaders graph_file_savers)
ament_package()
6 changes: 4 additions & 2 deletions nav2_route/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -396,7 +396,8 @@ Note that there are parameters like `prune_goal`, `min_distance_from_start` and

# Steve's TODO list

- [ ] Sample files: AWS final + TB3 sandbox world
- [ ] path marker points align with direction
- [ ] Sample files: AWS final
- [ ] QGIS demo + plugins for editing and visualizing graphs
- [ ] use map for checking start/goal nodes for infra blockages not just NN. Evaluate K. Share costmap?

Expand All @@ -406,11 +407,12 @@ Note that there are parameters like `prune_goal`, `min_distance_from_start` and
- Keep graph visualization in rviz but turn off by default
- Default graph sandbox + launch configuration to set (and get filepath + mirror `map` comments).

- Tutorials (bt change, plugin customize, file field examples)
- Tutorials (bt xml change, plugin customize (op/edge), file field examples)
- BT XMLs (first/last mile, freq. replanning, navigation using it, WPF using it, clearance)
- Demos (route -> global -> local. outdoor non-planar. waypoint follower (GPS?) of route nodes. controller server of dense path)

- Finish system test with route file + evaluation
- stop / clearance

- [ ] Testing by users

Expand Down
1 change: 1 addition & 0 deletions nav2_route/graphs/scripts/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
These scripts are used to help automate parts of route graph generation process.
19 changes: 19 additions & 0 deletions nav2_route/graphs/scripts/export_shapefiles.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
import geopandas as gpd
import pandas as pd
import sys
from datetime import datetime

try:
file_prefix = sys.argv[1]
edges = gpd.read_file(sys.argv[2])
nodes = gpd.read_file(sys.argv[3])
except:
raise Exception("Incorrect arguements provided")

now = datetime.now()

graph = pd.concat([nodes, edges])

file_name = file_prefix + "_" + now.strftime("%m_%d_%Y_%H_%M_%S") + ".geojson"

graph.to_file(file_name, driver='GeoJSON')
22 changes: 22 additions & 0 deletions nav2_route/graphs/scripts/generate_start_and_end_id.sql
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
WITH start_points AS
(
SELECT n.id AS node_id
,e.id AS edge_id
,e.geometry AS edge_geometry
FROM edges AS e, nodes AS n
WHERE ST_INTERSECTS(n.geometry, ST_StartPoint(e.geometry))
), end_points AS
(
SELECT n.id AS node_id
,e.id AS edge_id
,e.geometry AS edge_geometry
FROM edges AS e, nodes AS n
WHERE ST_INTERSECTS(n.geometry, ST_EndPoint(e.geometry))
)
SELECT sp.edge_id AS edge_id
,sp.node_id AS start_node
,ep.node_id AS end_node
,sp.edge_geometry AS geometry
FROM start_points AS sp
JOIN end_points AS ep
ON sp.edge_id = ep.edge_id
21 changes: 21 additions & 0 deletions nav2_route/graphs/scripts/increment_edge_id.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
{
"author": "josh",
"exported_at": "2023-03-15T19:27:03",
"expressions": [
{
"description": "<!DOCTYPE HTML PUBLIC \"-//W3C//DTD HTML 4.0//EN\" \"http://www.w3.org/TR/REC-html40/strict.dtd\">\n<html><head><style type=\"text/css\">\np, li { white-space: pre-wrap; }\n</style></head><body style=\" font-family:'Ubuntu'; font-size:11pt; font-weight:400; font-style:normal;\">\n<p style=\"-qt-paragraph-type:empty; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;\"><br /></p></body></html>",
"expression": "if(maximum(\"id\") is null, 10000, maximum(\"id\")+1)",
"group": "user",
"name": "increment_edge_id",
"type": "expression"
},
{
"description": "<!DOCTYPE HTML PUBLIC \"-//W3C//DTD HTML 4.0//EN\" \"http://www.w3.org/TR/REC-html40/strict.dtd\">\n<html><head><style type=\"text/css\">\np, li { white-space: pre-wrap; }\n</style></head><body style=\" font-family:'Ubuntu'; font-size:11pt; font-weight:400; font-style:normal;\">\n<p style=\"-qt-paragraph-type:empty; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;\"><br /></p></body></html>",
"expression": "if(maximum(\"id\") is null, 0, maximum(\"id\")+1)",
"group": "user",
"name": "increment_node_id",
"type": "expression"
}
],
"qgis_version": "3.22.4-Białowieża"
}
14 changes: 14 additions & 0 deletions nav2_route/graphs/scripts/increment_node_id.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
{
"author": "josh",
"exported_at": "2023-03-15T19:22:14",
"expressions": [
{
"description": "<!DOCTYPE HTML PUBLIC \"-//W3C//DTD HTML 4.0//EN\" \"http://www.w3.org/TR/REC-html40/strict.dtd\">\n<html><head><style type=\"text/css\">\np, li { white-space: pre-wrap; }\n</style></head><body style=\" font-family:'Ubuntu'; font-size:11pt; font-weight:400; font-style:normal;\">\n<p style=\"-qt-paragraph-type:empty; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;\"><br /></p></body></html>",
"expression": "if(maximum(\"id\") is null, 0, maximum(\"id\")+1)",
"group": "user",
"name": "increment_node_id",
"type": "expression"
}
],
"qgis_version": "3.22.4-Białowieża"
}
Loading