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

Add parameter services #342

Merged
merged 30 commits into from
May 14, 2024
Merged
Show file tree
Hide file tree
Changes from 15 commits
Commits
Show all changes
30 commits
Select commit Hold shift + click to select a range
c1662fd
WIP Adding describe paramater service
luca-della-vedova Nov 3, 2023
2ff7638
Implement parameter setting services
luca-della-vedova Nov 6, 2023
3b6e6e3
Restructure and cleanup
luca-della-vedova Nov 6, 2023
322f760
Merge remote-tracking branch 'origin/main' into luca/parameter_service
luca-della-vedova Nov 7, 2023
c14417b
Implement list_parameters with prefixes
luca-della-vedova Nov 7, 2023
f9bc86d
Minor cleanups
luca-della-vedova Nov 7, 2023
0605261
Fix tests, cleanups
luca-della-vedova Nov 7, 2023
6f8a6ef
Fix order of drop calls
luca-della-vedova Nov 7, 2023
45ccda9
Add first bunch of unit tests for list and get / set parameters
luca-della-vedova Nov 8, 2023
315e088
Clear warnings in rclrs
luca-della-vedova Nov 8, 2023
8d53f2a
Fix clippy, add set atomically tests
luca-della-vedova Nov 9, 2023
095a00f
Add describe parameter and get parameter types tests
luca-della-vedova Nov 9, 2023
e34a4b9
Merge branch 'main' into luca/parameter_service
luca-della-vedova Dec 7, 2023
d3585ca
Minor cleanups, remove several unwraps
luca-della-vedova Mar 18, 2024
74f384d
Remove commented code
luca-della-vedova Mar 18, 2024
68ccd97
Address first round of feedback
luca-della-vedova Mar 19, 2024
1360479
Allow undeclared parameters in parameter getting services
luca-della-vedova Mar 19, 2024
eb354a6
Clippy
luca-della-vedova Mar 19, 2024
06ca77e
Merging with main
mxgrey Apr 8, 2024
fbfdf2e
Run rustfmt
mxgrey Apr 8, 2024
cdf3854
Update rclrs/src/parameter/service.rs
luca-della-vedova Apr 12, 2024
fc7598d
Merge branch 'main' into luca/parameter_service
luca-della-vedova Apr 12, 2024
3274f42
Change behavior to return NOT_SET for non existing parameters
luca-della-vedova Apr 23, 2024
00c7951
Make use_sim_time parameter read only
luca-della-vedova Apr 23, 2024
e4dd176
Format
luca-della-vedova Apr 23, 2024
5da50a2
Add a comment to denote why unwrap is safe
luca-della-vedova Apr 23, 2024
9b2577c
Merge branch 'main' into luca/parameter_service
luca-della-vedova Apr 29, 2024
d73d07c
Use main fmt
luca-della-vedova Apr 29, 2024
f2cc667
Add a builder parameter to start parameter services
luca-della-vedova Apr 29, 2024
4b68266
Merge branch 'main' into luca/parameter_service
luca-della-vedova May 13, 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
7 changes: 5 additions & 2 deletions rclrs/src/node.rs
Original file line number Diff line number Diff line change
Expand Up @@ -65,14 +65,17 @@ unsafe impl Send for rcl_node_t {}
/// [3]: crate::NodeBuilder::new
/// [4]: crate::NodeBuilder::namespace
pub struct Node {
pub(crate) rcl_node_mtx: Arc<Mutex<rcl_node_t>>,
pub(crate) rcl_context_mtx: Arc<Mutex<rcl_context_t>>,
pub(crate) clients_mtx: Mutex<Vec<Weak<dyn ClientBase>>>,
pub(crate) guard_conditions_mtx: Mutex<Vec<Weak<GuardCondition>>>,
pub(crate) services_mtx: Mutex<Vec<Weak<dyn ServiceBase>>>,
pub(crate) subscriptions_mtx: Mutex<Vec<Weak<dyn SubscriptionBase>>>,
time_source: TimeSource,
parameter: ParameterInterface,
// Note: it's important to have those last since `drop` will be called in order of declaration
// in the struct and both `TimeSource` and `ParameterInterface` contain subscriptions /
// services that will fail to be dropped if the context or node is destroyed first.
pub(crate) rcl_node_mtx: Arc<Mutex<rcl_node_t>>,
pub(crate) rcl_context_mtx: Arc<Mutex<rcl_context_t>>,
}

impl Eq for Node {}
Expand Down
1 change: 1 addition & 0 deletions rclrs/src/node/builder.rs
Original file line number Diff line number Diff line change
Expand Up @@ -299,6 +299,7 @@ impl NodeBuilder {
parameter,
});
node.time_source.attach_node(&node);
node.parameter.create_services(&node)?;
luca-della-vedova marked this conversation as resolved.
Show resolved Hide resolved
Ok(node)
}

Expand Down
6 changes: 3 additions & 3 deletions rclrs/src/node/graph.rs
Original file line number Diff line number Diff line change
Expand Up @@ -497,16 +497,16 @@ mod tests {

assert!(subscription_infos.is_empty());

// Test that the graph has no services
// Test that the graph only has 6 services (parameter services)
let names_and_topics = node
.get_service_names_and_types_by_node(node_name, "")
.unwrap();

assert_eq!(names_and_topics.len(), 0);
assert_eq!(names_and_topics.len(), 6);

let names_and_topics = node.get_service_names_and_types().unwrap();

assert_eq!(names_and_topics.len(), 0);
assert_eq!(names_and_topics.len(), 6);

// Test that the graph has no clients
let names_and_topics = node
Expand Down
Loading
Loading