Add panic to sim time examples
This commit is contained in:
parent
0fd206ca4f
commit
c23e2eb1f6
|
|
@ -32,4 +32,5 @@ fn main() -> Result<(), Box<dyn std::error::Error>> {
|
||||||
|
|
||||||
#[cfg(not(r2r__rosgraph_msgs__msg__Clock))]
|
#[cfg(not(r2r__rosgraph_msgs__msg__Clock))]
|
||||||
fn main() {
|
fn main() {
|
||||||
|
panic!("Sim_time_publisher example is not compiled with 'rosgraph_msgs'.");
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -33,6 +33,7 @@ async fn timer_task(
|
||||||
|
|
||||||
/// Publication of time can be done either using the example `sim_time_publisher`
|
/// Publication of time can be done either using the example `sim_time_publisher`
|
||||||
/// or with `ros2 bag play --clock <clock_frequency> <the_bag>`
|
/// or with `ros2 bag play --clock <clock_frequency> <the_bag>`
|
||||||
|
#[cfg(r2r__rosgraph_msgs__msg__Clock)]
|
||||||
fn main() -> Result<(), Box<dyn std::error::Error>> {
|
fn main() -> Result<(), Box<dyn std::error::Error>> {
|
||||||
let ctx = r2r::Context::create()?;
|
let ctx = r2r::Context::create()?;
|
||||||
let mut node = r2r::Node::create(ctx, "testnode", "")?;
|
let mut node = r2r::Node::create(ctx, "testnode", "")?;
|
||||||
|
|
@ -80,3 +81,8 @@ fn main() -> Result<(), Box<dyn std::error::Error>> {
|
||||||
|
|
||||||
Ok(())
|
Ok(())
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#[cfg(not(r2r__rosgraph_msgs__msg__Clock))]
|
||||||
|
fn main() {
|
||||||
|
panic!("Timer_sim_time example is not compiled with 'rosgraph_msgs'.");
|
||||||
|
}
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue