-
Notifications
You must be signed in to change notification settings - Fork 6
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
carter
committed
May 21, 2024
1 parent
a960266
commit 38c2021
Showing
7 changed files
with
123 additions
and
33 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
roslibrust_codegen_macro::find_and_generate_ros_messages!("assets/ros1_common_interfaces"); | ||
|
||
#[cfg(feature = "ros1")] | ||
#[tokio::main] | ||
async fn main() -> Result<(), anyhow::Error> { | ||
use roslibrust::ros1::NodeHandle; | ||
|
||
simple_logger::SimpleLogger::new() | ||
.with_level(log::LevelFilter::Debug) | ||
.without_timestamps() | ||
.init() | ||
.unwrap(); | ||
|
||
let nh = NodeHandle::new("http://localhost:11311", "/service_client_rs").await?; | ||
log::info!("Connected!"); | ||
|
||
let response: rosapi::GetTimeResponse = nh | ||
.service_client::<rosapi::GetTime>("rosapi/get_time") | ||
.await? | ||
.call(&rosapi::GetTimeRequest {}) | ||
.await?; | ||
|
||
log::info!("Got time: {:?}", response); | ||
|
||
Ok(()) | ||
} | ||
|
||
#[cfg(not(feature = "ros1"))] | ||
fn main() { | ||
eprintln!("This example does nothing without compiling with the feature 'ros1'"); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters