Skip to content
Merged
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
14 changes: 7 additions & 7 deletions crates/nodes/active_vision/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -19,32 +19,32 @@ async fn run(ctx: Arc<Context>) -> Result<()> {

let _parameters = node.bind_parameter_as::<LookActionParameters>("active_vision")?;
let _field_dimensions_sub = node
.subscriber::<FieldDimensions>("field_dimensions")?
.subscriber::<FieldDimensions>("field_dimensions")
.qos(QosProfile {
durability: QosDurability::TransientLocal,
..Default::default()
})
.build()
.await?;
let _ball_sub = node.subscriber::<BallState>("ball_state")?.build().await?;
let _ball_sub = node.subscriber::<BallState>("ball_state").build().await?;
let _rule_ball_sub = node
.subscriber::<BallState>("rule_ball_state")?
.subscriber::<BallState>("rule_ball_state")
.build()
.await?;
let _obstacles_sub = node
.subscriber::<Vec<Obstacle>>("obstacles")?
.subscriber::<Vec<Obstacle>>("obstacles")
.build()
.await?;
let _ground_to_field_sub = node
.subscriber::<Isometry2<Ground, Field>>("ground_to_field")?
.subscriber::<Isometry2<Ground, Field>>("ground_to_field")
.build()
.await?;
let _filtered_game_controller_state_sub = node
.subscriber::<FilteredGameControllerState>("filtered_game_controller_state")?
.subscriber::<FilteredGameControllerState>("filtered_game_controller_state")
.build()
.await?;
let _position_of_interest_pub = node
.publisher::<Point2<Ground>>("position_of_interest")?
.publisher::<Point2<Ground>>("position_of_interest")
.build()
.await?;

Expand Down
20 changes: 11 additions & 9 deletions crates/nodes/ball_filter/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -41,15 +41,17 @@ pub async fn run(ctx: Arc<Context>) -> Result<()> {

let parameters = node.bind_parameter_as::<BallFilterParameters>("ball_filter")?;
let field_dimensions_sub = node
.create_cache::<FieldDimensions>("field_dimensions", 1)?
.with_qos(QosProfile {
.subscriber::<FieldDimensions>("field_dimensions")
.qos(QosProfile {
durability: QosDurability::TransientLocal,
..Default::default()
})
.cache(1)
.build()
.await?;
let camera_matrix_cache = node
.create_cache::<TimeWrapper<CameraMatrix>>("camera_matrix", 10)?
.subscriber::<TimeWrapper<CameraMatrix>>("camera_matrix")
.cache(10)
.with_stamp(|wrapper: &TimeWrapper<CameraMatrix>| wrapper.time)
.build()
.await?;
Expand All @@ -64,29 +66,29 @@ pub async fn run(ctx: Arc<Context>) -> Result<()> {
.await?
.build();
let filter_state_pub = node
.publisher::<BallFilter>("ball_filter/ball_filter_state")?
.publisher::<BallFilter>("ball_filter/ball_filter_state")
.build()
.await?;
let best_ball_hypothesis_pub = node
.publisher::<Option<BallHypothesis>>("ball_filter/best_ball_hypothesis")?
.publisher::<Option<BallHypothesis>>("ball_filter/best_ball_hypothesis")
.build()
.await?;
let filtered_balls_in_image_pub = node
.publisher::<Vec<Circle<Pixel>>>("ball_filter/filtered_balls_in_image")?
.publisher::<Vec<Circle<Pixel>>>("ball_filter/filtered_balls_in_image")
.build()
.await?;
let ball_percepts_pub = node
.publisher::<Vec<BallPercept>>("ball_filter/ball_percepts")?
.publisher::<Vec<BallPercept>>("ball_filter/ball_percepts")
.build()
.await?;
let ball_position_pub = node
.publisher::<Option<BallPosition<Ground>>>("ball_filter/ball_position")?
.publisher::<Option<BallPosition<Ground>>>("ball_filter/ball_position")
.build()
.await?;
let hypothetical_ball_positions_pub = node
.publisher::<Vec<HypotheticalBallPosition<Ground>>>(
"ball_filter/hypothetical_ball_positions",
)?
)
.build()
.await?;

Expand Down
25 changes: 14 additions & 11 deletions crates/nodes/ball_state_composer/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -24,47 +24,50 @@ async fn run(ctx: Arc<Context>) -> Result<()> {
let node = ctx.create_node("ball_state_composer").build().await?;

let field_dimensions_cache = node
.create_cache::<FieldDimensions>("field_dimensions", 1)?
.with_qos(QosProfile {
.subscriber::<FieldDimensions>("field_dimensions")
.qos(QosProfile {
durability: QosDurability::TransientLocal,
..Default::default()
})
.cache(1)
.build()
.await?;
let ball_position_sub = node
.subscriber::<Option<BallPosition<Ground>>>("ball_filter/ball_position")?
.subscriber::<Option<BallPosition<Ground>>>("ball_filter/ball_position")
.build()
.await?;
let ground_to_field_cache = node
.create_cache::<Isometry2<Ground, Field>>("ground_to_field", 10)?
.subscriber::<Isometry2<Ground, Field>>("ground_to_field")
.cache(10)
.build()
.await?;
let team_ball_sub = node
.subscriber::<BallPosition<Field>>("team_ball")?
.subscriber::<BallPosition<Field>>("team_ball")
.build()
.await?;
let primary_state_cache = node
.create_cache::<PrimaryState>("primary_state", 10)?
.with_qos(QosProfile {
.subscriber::<PrimaryState>("primary_state")
.qos(QosProfile {
durability: QosDurability::TransientLocal,
..Default::default()
})
.cache(10)
.build()
.await?;
let filtered_game_controller_state_sub = node
.subscriber::<FilteredGameControllerState>("filtered_game_controller_state")?
.subscriber::<FilteredGameControllerState>("filtered_game_controller_state")
.build()
.await?;
let additional_last_ball_state_pub = node
.publisher::<Option<LastBallState>>("last_ball_state")?
.publisher::<Option<LastBallState>>("last_ball_state")
.build()
.await?;
let ball_state_pub = node
.publisher::<Option<BallState>>("ball_state")?
.publisher::<Option<BallState>>("ball_state")
.build()
.await?;
let rule_ball_state_pub = node
.publisher::<Option<BallState>>("rule_ball_state")?
.publisher::<Option<BallState>>("rule_ball_state")
.build()
.await?;

Expand Down
61 changes: 38 additions & 23 deletions crates/nodes/behavior_node/src/node.rs
Original file line number Diff line number Diff line change
Expand Up @@ -127,100 +127,115 @@ pub async fn run(ctx: Arc<Context>) -> Result<()> {
let parameters = node.bind_parameter_as::<BehaviorParameters>("behavior_node")?;
parameters.add_validation_hook(validate_behavior_parameters)?;
let field_dimensions_cache = node
.create_cache::<FieldDimensions>("field_dimensions", 1)?
.with_qos(QosProfile {
.subscriber::<FieldDimensions>("field_dimensions")
.qos(QosProfile {
durability: QosDurability::TransientLocal,
..Default::default()
})
.cache(1)
.build()
.await?;

let player_number_cache = node
.create_cache::<PlayerNumber>("player_number", 1)?
.with_qos(QosProfile {
.subscriber::<PlayerNumber>("player_number")
.qos(QosProfile {
durability: QosDurability::TransientLocal,
..Default::default()
})
.cache(1)
.build()
.await?;
let player_states_cache = node
.create_cache::<Players<Option<TimeWrapper<PlayerState>>>>("player_states", 1)?
.subscriber::<Players<Option<TimeWrapper<PlayerState>>>>("player_states")
.cache(1)
.build()
.await?;
let fall_down_state_cache = node
.create_cache::<FallDownState>("inputs/fall_down_state", 1)?
.subscriber::<FallDownState>("inputs/fall_down_state")
.cache(1)
.build()
.await?;
let ball_state_cache = node
.create_cache::<Option<BallState>>("ball_state", 1)?
.subscriber::<Option<BallState>>("ball_state")
.cache(1)
.build()
.await?;
let filtered_game_controller_state_cache = node
.create_cache::<FilteredGameControllerState>("filtered_game_controller_state", 1)?
.subscriber::<FilteredGameControllerState>("filtered_game_controller_state")
.cache(1)
.build()
.await?;
let game_controller_address_cache = node
.create_cache::<Option<SocketAddr>>("game_controller_address", 1)?
.subscriber::<Option<SocketAddr>>("game_controller_address")
.cache(1)
.build()
.await?;
let ground_to_field_cache = node
.create_cache::<Isometry2<Ground, Field>>("ground_to_field", 1)?
.subscriber::<Isometry2<Ground, Field>>("ground_to_field")
.cache(1)
.build()
.await?;
let hypothetical_ball_positions_cache = node
.create_cache::<Vec<HypotheticalBallPosition<Ground>>>("hypothetical_ball_positions", 1)?
.subscriber::<Vec<HypotheticalBallPosition<Ground>>>("hypothetical_ball_positions")
.cache(1)
.build()
.await?;
let obstacles_cache = node
.create_cache::<Vec<Obstacle>>("obstacles", 1)?
.subscriber::<Vec<Obstacle>>("obstacles")
.cache(1)
.build()
.await?;
let position_of_interest_cache = node
.create_cache::<Point2<Ground>>("position_of_interest", 1)?
.subscriber::<Point2<Ground>>("position_of_interest")
.cache(1)
.build()
.await?;
let primary_state_cache = node
.create_cache::<PrimaryState>("primary_state", 1)?
.with_qos(QosProfile {
.subscriber::<PrimaryState>("primary_state")
.qos(QosProfile {
durability: QosDurability::TransientLocal,
..Default::default()
})
.cache(1)
.build()
.await?;
let rule_ball_cache = node
.create_cache::<Option<BallState>>("rule_ball_state", 1)?
.subscriber::<Option<BallState>>("rule_ball_state")
.cache(1)
.build()
.await?;
let rule_obstacles_cache = node
.create_cache::<Vec<RuleObstacle>>("rule_obstacles", 1)?
.subscriber::<Vec<RuleObstacle>>("rule_obstacles")
.cache(1)
.build()
.await?;
let suggested_search_position_cache = node
.create_cache::<Point2<Field>>("suggested_search_position", 1)?
.subscriber::<Point2<Field>>("suggested_search_position")
.cache(1)
.build()
.await?;
let additional_behavior_trace_pub = node
.publisher::<NodeTrace>("behavior/trace")?
.publisher::<NodeTrace>("behavior/trace")
.build()
.await?;
let additional_behavior_tree_layout_pub = node
.publisher::<NodeTrace>("behavior/tree_layout")?
.publisher::<NodeTrace>("behavior/tree_layout")
.qos(QosProfile {
durability: QosDurability::TransientLocal,
..Default::default()
})
.build()
.await?;
let additional_black_board_pub = node
.publisher::<Blackboard>("behavior/blackboard")?
.publisher::<Blackboard>("behavior/blackboard")
.build()
.await?;
let outgoing_message_pub = node
.publisher::<OutgoingMessage>("outputs/message")?
.publisher::<OutgoingMessage>("outputs/message")
.build()
.await?;
let motion_command_pub = node
.publisher::<MotionCommand>("behavior/motion_command")?
.publisher::<MotionCommand>("behavior/motion_command")
.build()
.await?;

Expand Down
6 changes: 3 additions & 3 deletions crates/nodes/booster_sdk_interface/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -138,16 +138,16 @@ async fn run(ctx: Arc<Context>) -> Result<()> {
let light_control_client = Arc::new(LightControlClient::new()?);

let led_command_sub = node
.subscriber::<LedCommand>("commands/led_command")?
.subscriber::<LedCommand>("commands/led_command")
.build()
.await?;
let high_level_command_sub = node
.subscriber::<HighLevelCommand>("commands/high_level_command")?
.subscriber::<HighLevelCommand>("commands/high_level_command")
.build()
.await?;

let mut robot_mode_service: ServiceServer<GetRobotMode> = node
.create_service_server::<GetRobotMode>("services/get_robot_mode")?
.service_server::<GetRobotMode>("services/get_robot_mode")
.build()
.await?;

Expand Down
2 changes: 1 addition & 1 deletion crates/nodes/button_event_bridge/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ async fn run(ctx: Arc<Context>) -> Result<()> {
.await
.map_err(|error| color_eyre::eyre::eyre!("{error}"))?;
let button_event_message_pub = node
.publisher::<ButtonEventMsg>("inputs/button_event_message")?
.publisher::<ButtonEventMsg>("inputs/button_event_message")
.build()
.await?;

Expand Down
4 changes: 2 additions & 2 deletions crates/nodes/button_event_handler/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -14,11 +14,11 @@ pub fn run_boxed(ctx: Arc<Context>) -> Pin<Box<dyn Future<Output = Result<()>> +
async fn run(ctx: Arc<Context>) -> Result<()> {
let node = ctx.create_node("button_event_handler").build().await?;
let button_event_message_sub = node
.subscriber::<ButtonEventMsg>("inputs/button_event_message")?
.subscriber::<ButtonEventMsg>("inputs/button_event_message")
.build()
.await?;
let buttons_pub = node
.publisher::<Buttons<Option<ButtonPressType>>>("buttons")?
.publisher::<Buttons<Option<ButtonPressType>>>("buttons")
.build()
.await?;

Expand Down
10 changes: 6 additions & 4 deletions crates/nodes/camera_matrix_calculator/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -21,21 +21,23 @@ async fn run(ctx: Arc<Context>) -> Result<()> {
let parameters =
node.bind_parameter_as::<CameraMatrixParameters>("camera_matrix_calculator")?;
let robot_kinematics_cache = node
.create_cache::<TimeWrapper<RobotKinematics>>("robot_kinematics", 10)?
.subscriber::<TimeWrapper<RobotKinematics>>("robot_kinematics")
.cache(10)
.with_stamp(|w: &TimeWrapper<RobotKinematics>| w.time)
.build()
.await?;
let robot_to_ground_sub = node
.subscriber::<TimeWrapper<Option<Isometry3<Robot, Ground>>>>("robot_to_ground")?
.subscriber::<TimeWrapper<Option<Isometry3<Robot, Ground>>>>("robot_to_ground")
.build()
.await?;
let camera_info_cache = node
.create_cache::<CameraInfo>("inputs/camera_info", 1)?
.subscriber::<CameraInfo>("inputs/camera_info")
.cache(1)
.build()
.await?;

let camera_matrix_pub = node
.publisher::<TimeWrapper<CameraMatrix>>("camera_matrix")?
.publisher::<TimeWrapper<CameraMatrix>>("camera_matrix")
.build()
.await?;

Expand Down
8 changes: 4 additions & 4 deletions crates/nodes/detection/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -61,19 +61,19 @@ async fn run(ctx: Arc<Context>) -> Result<()> {
let node_parameters = node.bind_parameter_as::<DetectionParameters>("detection")?;

let image_sub = node
.subscriber::<TimeWrapper<Image>>("inputs/left_image")?
.subscriber::<TimeWrapper<Image>>("inputs/left_image")
.build()
.await?;
let inference_duration_pub = node
.publisher::<Duration>("inference_duration")?
.publisher::<Duration>("inference_duration")
.build()
.await?;
let post_processing_duration_pub = node
.publisher::<Duration>("post_processing_duration")?
.publisher::<Duration>("post_processing_duration")
.build()
.await?;
let non_maximum_suppression_duration_pub = node
.publisher::<Duration>("non_maximum_suppression_duration")?
.publisher::<Duration>("non_maximum_suppression_duration")
.build()
.await?;
let detected_objects_pub = node
Expand Down
Loading
Loading