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

Adds a simple parking spot management system. #325

Open
wants to merge 133 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from 81 commits
Commits
Show all changes
133 commits
Select commit Hold shift + click to select a range
a9da70a
Bump main to 2.3.2 (#299)
Yadunund Aug 28, 2023
8a71324
Cancel automatic pending tasks that are removed during new assignment…
aaronchongth Sep 28, 2023
480f439
Add support for multiple destinations in `GoToPlace`
arjo129 Nov 21, 2023
267d200
Missed the schema
arjo129 Nov 21, 2023
a316675
Update schema to follow @mxgrey's specifications.
arjo129 Nov 21, 2023
6dda072
Tweaking implementation
mxgrey Dec 18, 2023
3a3786e
Mutex groups, dynamic charging, and more (#310)
mxgrey Dec 15, 2023
9e90fd7
Update changelog and bump version (#311)
mxgrey Dec 15, 2023
93729d5
Fix merge with main
mxgrey Dec 18, 2023
433dc94
Fix same floor constraint parsing
mxgrey Dec 20, 2023
8c8ad1d
Fix a minor typo in fleet adapter error log
arjo129 Oct 31, 2023
9c06243
Add Reservation System node
arjo129 Nov 7, 2023
0eba733
Rework node for new flexible time API
arjo129 Jan 10, 2024
5e0cbe2
Adding support for reservation system in classic RMF
arjo129 Jan 16, 2024
6fe0d4f
Some things missing from previous push
arjo129 Jan 16, 2024
59fc995
Add support for releasing reservations
arjo129 Jan 26, 2024
e1c37fc
Added a simple C++ mutex based proto-reservation system
arjo129 Feb 1, 2024
76100b6
Adds a simple parking spot management system.
arjo129 Feb 5, 2024
705028a
Fix edge case when starting on a lane (#312)
mxgrey Dec 21, 2023
fe3534c
Update changelogs and 2.5.0 (#313)
Yadunund Dec 22, 2023
91ce68b
Adds an option to generate unique hex strings for new task ids, fix t…
aaronchongth Jan 22, 2024
7c51898
Add support of fleet-level task (#317)
cwrx777 Jan 26, 2024
ed96418
use keep_last(10) for all instances without a depth already set
Jan 31, 2024
5c04a66
style
Jan 31, 2024
a70a6ca
catch multi line usages
Jan 31, 2024
727dcbd
catch some extra edge cases
Jan 31, 2024
d4fc0bc
fix false positive
Feb 1, 2024
e4e9433
Change emergency pullover behaviour.
arjo129 Feb 7, 2024
b38612e
Style
arjo129 Feb 7, 2024
3af172e
Remove holding time nonsense.
arjo129 Feb 16, 2024
317ee7f
Don't wait for retry. immediately plan.
arjo129 Mar 1, 2024
98d3b37
Cancel retry timer
arjo129 Mar 1, 2024
dd65259
Better logging.
arjo129 Mar 1, 2024
bcde5fe
merge
arjo129 Apr 26, 2024
dfbcdfe
add in_lift readonly property in Graph::Waypoint binding. (#326)
cwrx777 Feb 28, 2024
3badb2e
Add Backward-ROS for improved logging in event of segfaults (#327)
arjo129 Mar 6, 2024
ea0afb3
include cstdint header (#331)
Yadunund Mar 13, 2024
ccba1e5
Removes a line of dead code (#322)
arjo129 Mar 13, 2024
b10baee
Bump main to 2.6.0 (#332)
Yadunund Mar 13, 2024
145b9cf
Add Speed Limit Requests (#222) (#335)
Yadunund Mar 18, 2024
872213b
Fix interaction between emergency pullover and finishing task (#333)
mxgrey Mar 19, 2024
e92d165
Support labels in booking information (#328)
aaronchongth Mar 21, 2024
07b4a52
Release other mutexes if robot started charging (#334)
xiyuoh Mar 25, 2024
fac1703
Add all_known_lifts in Graph binding (#336)
cwrx777 Mar 25, 2024
8a4b9e8
Stabilize commissioning feature (#338)
mxgrey Apr 8, 2024
fd8fe46
Refactors the socket broadcast client (#329)
arjo129 Apr 8, 2024
0ded63b
Lower debug level of some messages in rmf_websocket (#340)
arjo129 Apr 9, 2024
61f712a
Manual release of mutex groups (#339)
mxgrey Apr 17, 2024
24ca1ac
Disable automatic retreat (#330)
xiyuoh Apr 18, 2024
1665859
Fix deadlock in websocket server (#342)
arjo129 Apr 23, 2024
caf32bf
Automatically begin or cancel idle behavior when commission changes (…
mxgrey Apr 25, 2024
5494dec
Add fleet-level reassign dispatched tasks API (#348)
xiyuoh May 6, 2024
908e00d
Fix schema dictionary used during robot status override (#349)
mxgrey May 7, 2024
eaec283
Filter DoorOpen insertion by map name (#353)
mxgrey May 10, 2024
dba5bbd
Event based lift / door logic (#320)
luca-della-vedova May 10, 2024
8df5bab
Fix segfault
arjo129 Jun 7, 2024
66afd15
Merge remote-tracking branch 'origin/main' into arjo/feat/integrated_…
arjo129 Jun 10, 2024
550c817
Fix compile issues.
arjo129 Jun 10, 2024
712848d
Merge branch 'main' into arjo/feat/integrated_ressys
arjo129 Jun 19, 2024
498365f
Merge branch 'main' into arjo/feat/integrated_ressys
arjo129 Jun 20, 2024
ec3f2de
Merge branch 'main' into arjo/feat/integrated_ressys
arjo129 Jul 15, 2024
f93747b
Merge branch 'main' into arjo/feat/integrated_ressys
luca-della-vedova Jul 18, 2024
1c89d26
Get config from yaml to `RobotContext`
arjo129 Jul 19, 2024
ad92262
Restore old behaviour by default.
arjo129 Jul 19, 2024
b8f0100
Only proceed if next spot is free.
arjo129 Jul 19, 2024
82176af
Still broken: Fixing implementation of wait and spot and then go beha…
arjo129 Jul 23, 2024
a51157f
Fix compilation eror
arjo129 Jul 24, 2024
999d04a
Giant refactor
arjo129 Jul 29, 2024
3a7d942
Merge remote-tracking branch 'origin/main' into arjo/feat/integrated_…
arjo129 Jul 31, 2024
ae62f4f
Basic queueing is working
arjo129 Jul 31, 2024
e39f83c
Looks like the segfault was thanks to some logging
arjo129 Jul 31, 2024
19e8618
So... I know how to fix the leak but that version does not work
arjo129 Aug 1, 2024
dfaa0ea
Fixed memory leak
arjo129 Aug 1, 2024
af2185d
Finally works fully
arjo129 Aug 2, 2024
0fefbb3
Add docs
arjo129 Aug 2, 2024
3b049bc
Whoops fix stray keystroke
arjo129 Aug 2, 2024
f90946d
Release in the correct place
arjo129 Aug 2, 2024
cf4885b
Merge remote-tracking branch 'origin/main' into arjo/feat/integrated_…
arjo129 Aug 5, 2024
2c18dcb
Code clean ups
arjo129 Aug 8, 2024
3f4bd8a
Fix typos
arjo129 Aug 8, 2024
020d7b1
Switched to names to support multiple graphs
arjo129 Aug 8, 2024
b264cfb
Refactoring and Stylistic changes
arjo129 Aug 14, 2024
49a82a6
Removing unused subscriber
arjo129 Aug 14, 2024
bdb8cc4
More refactoring
arjo129 Aug 16, 2024
f868131
More style fixes
arjo129 Aug 16, 2024
7728eb7
More style fixes
arjo129 Aug 16, 2024
7dcc41f
More style fixes
arjo129 Aug 16, 2024
7302369
More style fixes
arjo129 Aug 16, 2024
f8aad5d
More refactoring
arjo129 Aug 19, 2024
1af04f0
Was logging the wrong thing
arjo129 Aug 20, 2024
196bfdd
Update Readme
arjo129 Aug 21, 2024
da54f12
Fix deadlock
arjo129 Aug 21, 2024
eb97406
Style fixes
arjo129 Aug 21, 2024
7d41ece
Merge remote-tracking branch 'origin/main' into arjo/feat/integrated_…
arjo129 Aug 21, 2024
5dca4bb
Add support for getting lost
arjo129 Aug 27, 2024
62446ab
Fix segfault
arjo129 Aug 28, 2024
f424094
Fixed patrol behaviour
arjo129 Sep 2, 2024
ca75f7e
Support cancellation
arjo129 Sep 17, 2024
06afb59
More Refactors
arjo129 Sep 17, 2024
aff7fcb
Address namespacing issue
arjo129 Sep 17, 2024
33a7930
Style
arjo129 Sep 17, 2024
da01d5d
Style
arjo129 Sep 17, 2024
e4218cb
Merge branch 'main' into arjo/feat/integrated_ressys
arjo129 Sep 17, 2024
704d140
Fix navigation parameters
mxgrey Sep 24, 2024
32f2160
Mega Re-name
arjo129 Sep 25, 2024
66b546d
Merge branch 'main' into arjo/feat/integrated_ressys
arjo129 Sep 26, 2024
0da49f3
Mostly style fixes address shared pointer capture
arjo129 Sep 26, 2024
5b368d3
Merge branch 'arjo/feat/integrated_ressys' of github.com:open-rmf/rmf…
arjo129 Sep 26, 2024
646de63
More style fixes
arjo129 Sep 28, 2024
a00d34c
More style fixes
arjo129 Sep 30, 2024
b57cb3e
Rework how configurations are loaded so as not to break abi
arjo129 Sep 30, 2024
f2fced6
More cleanups
arjo129 Sep 30, 2024
3e5ccc2
More cleanups
arjo129 Sep 30, 2024
fc345f9
Copyright headers
arjo129 Sep 30, 2024
19f1eb2
Move make_request to worker thread lso make sure we only use the rese…
arjo129 Oct 1, 2024
66ea3ba
Style
arjo129 Oct 1, 2024
5e74ac2
Clean up readme
arjo129 Oct 1, 2024
f9d7195
Use rclcpp for logging everywhere
arjo129 Oct 2, 2024
ed07cb8
Cancellation flow
arjo129 Oct 2, 2024
3d25ec7
Make sure cancellation is done on worker
arjo129 Oct 2, 2024
9e16a6e
Use updated topic names
arjo129 Oct 3, 2024
d50e194
Clean up reservatiion Manager
arjo129 Oct 4, 2024
e68733f
Minor renames
arjo129 Oct 4, 2024
16531d6
Merge remote-tracking branch 'origin/main' into arjo/feat/integrated_…
arjo129 Oct 4, 2024
6373d8c
Fix compile error and rename variable to be more readable
arjo129 Oct 4, 2024
d016fbe
Remove key stroke
arjo129 Oct 4, 2024
d610e13
Fix logging levels and log robot id
arjo129 Oct 4, 2024
0b8e7fb
Remove retry timer.
arjo129 Oct 4, 2024
df7b21d
Merge branch 'main' into arjo/feat/integrated_ressys
mxgrey Oct 4, 2024
7efbf45
Refactor
arjo129 Oct 4, 2024
045c5ed
Merge branch 'arjo/feat/integrated_ressys' of github.com:open-rmf/rmf…
arjo129 Oct 4, 2024
1470440
Fixed memory leak
arjo129 Oct 5, 2024
c033f4b
An excellent example of something most modern languages would have pr…
arjo129 Oct 5, 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
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -5,3 +5,4 @@ tags
*.swo
*.vscode
compile_commands.json
rmf_reservation_ros2/target
arjo129 marked this conversation as resolved.
Show resolved Hide resolved
37 changes: 37 additions & 0 deletions rmf_chope_node/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
cmake_minimum_required(VERSION 3.8)
project(rmf_chope_node)

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)
find_package(rclcpp REQUIRED)
find_package(rmf_chope_msgs REQUIRED)
find_package(rmf_building_map_msgs REQUIRED)
# uncomment the following section in order to fill in
# further dependencies manually.
# find_package(<dependency> REQUIRED)

add_executable(queue_manager src/main.cpp)
ament_target_dependencies(queue_manager rclcpp rmf_chope_msgs rmf_building_map_msgs)

install(TARGETS
queue_manager
DESTINATION lib/${PROJECT_NAME})


if(BUILD_TESTING)
find_package(ament_lint_auto REQUIRED)
# the following line skips the linter which checks for copyrights
# comment the line when a copyright and license is added to all source files
set(ament_cmake_copyright_FOUND TRUE)
# the following line skips cpplint (only works in a git repo)
# comment the line when this package is in a git repo and when
# a copyright and license is added to all source files
set(ament_cmake_cpplint_FOUND TRUE)
ament_lint_auto_find_test_dependencies()
endif()

ament_package()
arjo129 marked this conversation as resolved.
Show resolved Hide resolved
54 changes: 54 additions & 0 deletions rmf_chope_node/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,54 @@
# rmf\_chope\_node package

"Chope" is the very singaporean act of throwing an item on a table and marking it at yours before going to get your food. The goal of this package is to provide the same functionality in RMF.
arjo129 marked this conversation as resolved.
Show resolved Hide resolved
Before a robot goes to its next destination the fleet adapter asks the chope-node if its next destination is available. If the destination is available the robot will immediately proceed to the next destination, otherwise it will allocate a free parking spot for the robot to wait at till the next destination becomes available in a FIFO manner. If you need more advanced methods than FIFO, feel free to hack this package. To enable the use of this package you need to add the following to your fleet configuration yaml at the fleet level and run the chope node:
```yaml
use_parking_reservations: True
```
We recommend disabling `responsive_wait` when you do so. An example is available in `rmf_demos`.

Some immediate limitations of the chope node is that it is limited to scenarios with a single navigation graph. Overcoming this limitation should not be too much work now that the basic infrastructure is in place.

## Expected Behaviour

### Basic queueing
You should never need to interact with this package directly. Rather, you can simply dispatch a task using the traditional methods. If you have `rmf_demos` installed you can run the
office world. We can start by commanding the `tinyRobot2` to go to the pantry.
arjo129 marked this conversation as resolved.
Show resolved Hide resolved
```bash
ros2 run rmf_demos_tasks dispatch_go_to_place -p pantry -F tinyRobot -R tinyRobot2 --use_sim_time
```
The robot should proceed as expected. We can then ask `tinyRobot1` to also go to the pantry. Nothing should happen as the pantry is already occupied and `tinyRobot1` is at its parking spot.
```bash
ros2 run rmf_demos_tasks dispatch_go_to_place -p pantry -F tinyRobot -R tinyRobot1 --use_sim_time
```
We can ask `tinyRobot2` to move to the lounge after this.
```bash
ros2 run rmf_demos_tasks dispatch_go_to_place -p lounge -F tinyRobot -R tinyRobot2 --use_sim_time
```
This should immediately trigger 2 things:
1. `tinyRobot2` will move to the lounge
2. `tinyRobot1` will proceed to move to the pantry taking tinyRobot2's place.

### Moving to a waitpoint
If we continue from the previous example. Lets ask `tinyRobot1` and `tinyRobot2` to swap places starting at the pantry and lounge respectively.
```bash
ros2 run rmf_demos_tasks dispatch_go_to_place -p pantry -F tinyRobot -R tinyRobot1 --use_sim_time
```
You should see tinyRobot1 move to`tinyRobot2_charger` as `lounge` is not a designated wait point. You can then command `tinyRobot2` to the lounge.
```bash
ros2 run rmf_demos_tasks dispatch_go_to_place -p lounge -F tinyRobot -R tinyRobot2 --use_sim_time
```
`tinyRobot1` and `tinyRobot2` should now proceed to swap places.

If you have the same number or more waitpoints than robots you should never have a deadlock.

## Protocol Used Behind the Scenes

The chope node has no idea about the state of the graph it simply maintains a list of available parking spots internally. The fleet adapter does most of the heavy lifting in the `GoToPlace`. When a `GoToPlace` event is started we first check if the robot is already at one of the target locations. The fleetadapter submits a `ReservationRequest` message with the desired end parameters. The parameters are listed in terms of cost (where the cost function is distance). The chope node will issue a ticket for said request.When ready to proceed, send a claim message with the ticket and with the list of potential waiting points ordered by distance. The chope node will then try to award the lowest cost target location. If it can't it will award the lowest cost waiting point to the robot. The fleet adapter will release the previous location as it starts to move to its next location.
arjo129 marked this conversation as resolved.
Show resolved Hide resolved

## Known Issues
1. At start up if there is no idle task, the chope node will not know where the robots are. It is advised to send 1 `GoToPlace` task for every robot that is added to the world.

## Quality Declaration

This package claims to be in the **Quality Level 4** category. See the [Quality Declaration](QUALITY_DECLARATION.md) for more details.
21 changes: 21 additions & 0 deletions rmf_chope_node/package.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
<?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_chope_node</name>
<version>0.0.0</version>
<description>Node that handles current state of parking spots.</description>
<maintainer email="arjoc@intrinsic.ai">Arjo Chakravarty</maintainer>
<license>Apache License 2.0</license>

<buildtool_depend>ament_cmake</buildtool_depend>

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

<depend>rmf_building_map_msgs</depend>
<depend>rmf_chope_msgs</depend>

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