Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
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
4 changes: 4 additions & 0 deletions rclrs/minimal_client_service/src/minimal_client.rs
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,10 @@ fn main() -> Result<(), Error> {

let client = node.create_client::<AddTwoInts>("add_two_ints")?;

// Enable introspection for this client
// if you want to be able to introspect the service calls e.g. with ros2 service echo
client.configure_introspection(ServiceIntrospectionState::Contents)?;

let promise = executor.commands().run(async move {
println!("Waiting for service...");
client.notify_on_service_ready().await.unwrap();
Expand Down
6 changes: 5 additions & 1 deletion rclrs/minimal_client_service/src/minimal_service.rs
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,11 @@ fn main() -> Result<(), Error> {

let node = executor.create_node("minimal_service")?;

let _server = node.create_service::<AddTwoInts, _>("add_two_ints", handle_service)?;
let server = node.create_service::<AddTwoInts, _>("add_two_ints", handle_service)?;

// Enable introspection for this service
// if you want to be able to introspect the service calls e.g. with ros2 service echo
server.configure_introspection(ServiceIntrospectionState::Contents)?;

println!("Starting server");
executor.spin(SpinOptions::default()).first_error()?;
Expand Down