Skip to content

Commit

Permalink
Remove time related changes
Browse files Browse the repository at this point in the history
Signed-off-by: Luca Della Vedova <lucadv@intrinsic.ai>
  • Loading branch information
luca-della-vedova committed Oct 5, 2023
1 parent ccc91e9 commit 7f0d86a
Show file tree
Hide file tree
Showing 10 changed files with 11 additions and 529 deletions.
2 changes: 0 additions & 2 deletions rclrs/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,6 @@ ament_rs = { version = "0.2", optional = true }
futures = "0.3"
# Needed for dynamic messages
libloading = { version = "0.8", optional = true }
# Needed for /clock topic subscription when using simulation time
rosgraph_msgs = "*"
# Needed for the Message trait, among others
rosidl_runtime_rs = "0.3"

Expand Down
1 change: 0 additions & 1 deletion rclrs/package.xml
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,6 @@
<build_depend>rcl</build_depend>
<depend>builtin_interfaces</depend>
<depend>rcl_interfaces</depend>
<depend>rosgraph_msgs</depend>

<export>
<build_type>ament_cargo</build_type>
Expand Down
219 changes: 0 additions & 219 deletions rclrs/src/clock.rs

This file was deleted.

8 changes: 1 addition & 7 deletions rclrs/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@
mod arguments;
mod client;
mod clock;
mod context;
mod error;
mod executor;
Expand All @@ -17,8 +16,6 @@ mod publisher;
mod qos;
mod service;
mod subscription;
mod time;
mod time_source;
mod vendor;
mod wait;

Expand All @@ -32,7 +29,6 @@ use std::time::Duration;

pub use arguments::*;
pub use client::*;
pub use clock::*;
pub use context::*;
pub use error::*;
pub use executor::*;
Expand All @@ -43,8 +39,6 @@ pub use qos::*;
pub use rcl_bindings::rmw_request_id_t;
pub use service::*;
pub use subscription::*;
pub use time::*;
use time_source::*;
pub use wait::*;

/// Polls the node for new messages and executes the corresponding callbacks.
Expand Down Expand Up @@ -86,7 +80,7 @@ pub fn spin(node: Arc<Node>) -> Result<(), RclrsError> {
/// # Ok::<(), RclrsError>(())
/// ```
pub fn create_node(context: &Context, node_name: &str) -> Result<Arc<Node>, RclrsError> {
Node::new(context, node_name)
Ok(Arc::new(Node::new(context, node_name)?))
}

/// Creates a [`NodeBuilder`][1].
Expand Down
14 changes: 4 additions & 10 deletions rclrs/src/node.rs
Original file line number Diff line number Diff line change
Expand Up @@ -13,9 +13,9 @@ pub use self::builder::*;
pub use self::graph::*;
use crate::rcl_bindings::*;
use crate::{
Client, ClientBase, Clock, Context, Declarable, GuardCondition, ParameterBuilder,
ParameterInterface, ParameterVariant, Parameters, Publisher, QoSProfile, RclrsError, Service,
ServiceBase, Subscription, SubscriptionBase, SubscriptionCallback, TimeSource, ToResult,
Client, ClientBase, Context, Declarable, GuardCondition, ParameterBuilder, ParameterInterface,
ParameterVariant, Parameters, Publisher, QoSProfile, RclrsError, Service, ServiceBase,
Subscription, SubscriptionBase, SubscriptionCallback, ToResult,
};

impl Drop for rcl_node_t {
Expand Down Expand Up @@ -72,7 +72,6 @@ pub struct Node {
pub(crate) services_mtx: Mutex<Vec<Weak<dyn ServiceBase>>>,
pub(crate) subscriptions_mtx: Mutex<Vec<Weak<dyn SubscriptionBase>>>,
_parameter: ParameterInterface,
_time_source: TimeSource,
}

impl Eq for Node {}
Expand All @@ -96,15 +95,10 @@ impl Node {
///
/// See [`NodeBuilder::new()`] for documentation.
#[allow(clippy::new_ret_no_self)]
pub fn new(context: &Context, node_name: &str) -> Result<Arc<Node>, RclrsError> {
pub fn new(context: &Context, node_name: &str) -> Result<Node, RclrsError> {
Self::builder(context, node_name).build()
}

/// Returns the clock associated with this node.
pub fn get_clock(&self) -> Clock {
self._time_source.get_clock()
}

/// Returns the name of the node.
///
/// This returns the name after remapping, so it is not necessarily the same as the name that
Expand Down
Loading

0 comments on commit 7f0d86a

Please sign in to comment.