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

Flexible task definitions #39

Merged
merged 88 commits into from
Feb 13, 2022
Merged
Changes from 1 commit
Commits
Show all changes
88 commits
Select commit Hold shift + click to select a range
29f3b8c
Remove agv namespace and introduce CompositeData
mxgrey Sep 1, 2021
2ea66b5
Redesign State to be composable
mxgrey Sep 2, 2021
b181017
Defining task execution interfaces
mxgrey Sep 2, 2021
096ae8a
Adding a task logging interface
mxgrey Sep 3, 2021
86c3c13
Drafting the interfaces for phase sequence tasks
mxgrey Sep 3, 2021
e00b02c
Satisfy uncrustify
mxgrey Sep 3, 2021
7a7d7d3
Draft interface for Task Factory
mxgrey Sep 3, 2021
15aac52
Rework the design, improve consistency
mxgrey Sep 6, 2021
873693a
Satisfy uncrustify
mxgrey Sep 6, 2021
67f9398
Beginning to implement GoToPlace::Description
mxgrey Sep 6, 2021
68f2fda
Redesigning travel estimation cache
mxgrey Sep 7, 2021
1707f4f
Redesigning travel estimation
mxgrey Sep 7, 2021
45d62a6
Prototyping PickUp phase
mxgrey Sep 8, 2021
81380c8
Finish implementation of PickUp and begin API of DropOff
mxgrey Sep 9, 2021
21054b9
Implementing DropOff phase
mxgrey Sep 10, 2021
3b83b5d
Reorganizing
mxgrey Sep 10, 2021
7c31994
More reorganization
mxgrey Sep 10, 2021
9103c90
Gradually ironing out the transition to the reorganization
mxgrey Sep 10, 2021
66777a8
Continuing implementation of phase sequence task
mxgrey Sep 11, 2021
820cc33
Thinking about how to implement backups for phase sequence tasks
mxgrey Sep 13, 2021
5e14e82
Work reactive backup callbacks into the system
mxgrey Sep 13, 2021
e330d36
Creating minimal example of task activation
mxgrey Sep 13, 2021
d2911aa
Create minimal example of task restoring
mxgrey Sep 14, 2021
3505ac0
Use derived class implementation of backup
mxgrey Sep 14, 2021
724eb0a
Finish comment
mxgrey Sep 14, 2021
ecbe258
Creating an integration test to guide the implementation of backups
mxgrey Sep 14, 2021
37830d5
Move backups test into integration folder
mxgrey Sep 14, 2021
56c1f40
Continuing to implement backup and restore for phase sequence tasks
mxgrey Sep 23, 2021
ed651ae
Finished backup/restore implementation -- needs testing
mxgrey Sep 24, 2021
e1c2d51
Implementing phase activator
mxgrey Sep 24, 2021
3995281
Migrating to JSON and json-schema
mxgrey Oct 6, 2021
e2116b0
Fix header guards and begin schema header template
mxgrey Oct 6, 2021
8c2844f
Working on the generation of schema headers
mxgrey Oct 7, 2021
0615abf
Update transitive dependency
mxgrey Oct 7, 2021
973b387
Merge branch 'redesign_v2' of ssh://github.com/open-rmf/rmf_task into…
mxgrey Oct 7, 2021
05b4754
Able to generate schemas
mxgrey Oct 7, 2021
d730e02
Reimplement backups using json
mxgrey Oct 7, 2021
ae6c0c7
Include original message in error log
mxgrey Oct 11, 2021
d744b63
Put active phase snapshots into completed phases
mxgrey Oct 12, 2021
eab243b
Iterating on RestoreBackup phase
mxgrey Oct 13, 2021
cc329cf
Implement backup file manager (#41)
cnboonhan Oct 14, 2021
76ec880
Fix merge conflicts
mxgrey Oct 14, 2021
a7b3bc4
Rename Condition to Event
mxgrey Oct 14, 2021
7aee6bc
Introducing VersionedString and using it for event names + details
mxgrey Oct 15, 2021
fbb2160
Implementing the SimpleEvent class
mxgrey Oct 15, 2021
f1d3f62
Migrate to using the RestoreBackup phase
mxgrey Oct 18, 2021
6b46765
Abstracting Phase and Event interfaces into Activity
mxgrey Oct 18, 2021
cfb1e90
Finish refactoring to introduce Activity class namespace
mxgrey Oct 20, 2021
0611526
Remove the GoToPlace phase in favor of GoToPlace event
mxgrey Oct 20, 2021
d19c7ad
Remember to include <string>
mxgrey Oct 21, 2021
7d8db73
Use a const reference for pending tasks
mxgrey Oct 21, 2021
11831e0
Remember to include <string> pt. 2
mxgrey Oct 21, 2021
c720ffb
Refactoring Event to State, Standby, and Active, and implementing Eve…
mxgrey Nov 1, 2021
390f5a4
Implementing Event Sequence Standby
mxgrey Nov 1, 2021
54765af
Implementing the Event Sequence class
mxgrey Nov 3, 2021
036867b
Define the schema for event sequence backups
mxgrey Nov 3, 2021
eaf95ea
Finished implementing event sequence
mxgrey Nov 6, 2021
56ec2a2
Refactoring Sequence into a more generic Bundle
mxgrey Nov 6, 2021
cb5619c
Migrating schema header generation to rmf_api_msgs
mxgrey Nov 10, 2021
df57b7f
Add some conceptual sample schemas for task descriptions
mxgrey Nov 10, 2021
a0e39f7
Move schemas into subdirectory
mxgrey Nov 24, 2021
2108d42
Merge branch 'redesign_v2_task_schemas' into redesign_v2_Bundle
mxgrey Nov 24, 2021
3610da5
tweaks
mxgrey Nov 30, 2021
10fd78a
Refactor Sequence into Bundle
mxgrey Dec 7, 2021
2314e14
Filling in implementation gaps and beginning task sequence test
mxgrey Dec 8, 2021
1dd1659
Fix implementation bugs and begin unit tests for task sequences
mxgrey Dec 9, 2021
d11032e
Allow event bundles to be activated from a vector of Standbys
mxgrey Dec 14, 2021
cc8bf3d
Allow users to directly create Bundle Standbys, not Actives
mxgrey Dec 14, 2021
7420e52
Implement unfolding for tasks and events
mxgrey Dec 16, 2021
9842bd9
Remember to include implementation header
mxgrey Dec 16, 2021
0112e25
Make activate and restore const
mxgrey Dec 17, 2021
070e864
Add sequence numbers to logs and fix log iteration
mxgrey Dec 20, 2021
3aef75f
Add plain text info for task descriptions
mxgrey Dec 21, 2021
416503d
Handle cases with no ambient drain
mxgrey Dec 22, 2021
f05dda0
Create a Placeholder event to help eliminate boilerplate
mxgrey Dec 22, 2021
9fbd9d4
Fix circular reference
mxgrey Dec 31, 2021
113b671
Return more specific Clean Description
mxgrey Jan 9, 2022
c6b9ed4
fix empty itinerary duration
youliangtan Jan 18, 2022
c4d17fb
PerformAction Event Description (#49)
Yadunund Jan 20, 2022
dc4bbdb
nit rosdep json pkg name
youliangtan Jan 26, 2022
b783c18
Fix segfaults with PerformAction (#51)
Yadunund Jan 27, 2022
8195e4b
Use ament_uncrustify
Yadunund Jan 28, 2022
75b5f93
compile tests (#52)
xiyuoh Jan 28, 2022
ec67d50
Report the active phase's start time
mxgrey Feb 10, 2022
a895149
Merge branch 'main' into redesign_v2
mxgrey Feb 12, 2022
a8f63f0
Update repos
mxgrey Feb 12, 2022
a9b6ec6
Merge branch 'redesign_v2' of ssh://github.com/open-rmf/rmf_task into…
mxgrey Feb 12, 2022
956cf5b
Satisfy uncrustify
mxgrey 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
Prev Previous commit
Next Next commit
Fix circular reference
Signed-off-by: Michael X. Grey <[email protected]>
mxgrey committed Dec 31, 2021
commit 9fbd9d403d7e5d0dba6045b722efc56d15687c80
56 changes: 55 additions & 1 deletion rmf_task_sequence/src/rmf_task_sequence/events/Bundle.cpp
Original file line number Diff line number Diff line change
@@ -294,7 +294,61 @@ Header Bundle::Description::generate_header(
//==============================================================================
void Bundle::add(const Event::InitializerPtr& initializer)
{
add(*initializer, initializer);
initializer->add<Bundle::Description>(
[w = std::weak_ptr<Event::Initializer>(initializer)](
const AssignIDPtr& id,
const std::function<rmf_task::State()>& get_state,
const ConstParametersPtr& parameters,
const Bundle::Description& description,
std::function<void()> update)
{
const auto& initialize_from = w.lock();
if (!initialize_from)
{
throw std::runtime_error(
"[rmf_task_sequence::Bundle::add] Use-after-free error: Event "
"initializer has already destructed, but is still being used to "
"initialize an event.");
}

return initiate(
*initialize_from,
id,
get_state,
parameters,
description,
std::move(update));
},
[w = std::weak_ptr<Event::Initializer>(initializer)](
const AssignIDPtr& id,
const std::function<rmf_task::State()>& get_state,
const ConstParametersPtr& parameters,
const Bundle::Description& description,
const nlohmann::json& backup_state,
std::function<void()> update,
std::function<void()> checkpoint,
std::function<void()> finished)
{
const auto& initialize_from = w.lock();
if (!initialize_from)
{
throw std::runtime_error(
"[rmf_task_sequence::Bundle::add] Use-after-free error: Event "
"initializer has already destructed, but is still being used to "
"initialize an event.");
}

return restore(
*initialize_from,
id,
get_state,
parameters,
description,
backup_state,
std::move(update),
std::move(checkpoint),
std::move(finished));
});
}

//==============================================================================