Skip to content
Open
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
39 changes: 20 additions & 19 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 2 additions & 0 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ members = [
"crates/bevyhavior_simulator",
"crates/booster",
"crates/calibration",
"crates/cfg_aliases_0_1",
"crates/coordinate_systems",
"crates/egui_bevy",
"crates/energy_optimization",
Expand Down Expand Up @@ -350,6 +351,7 @@ zip = { version = "2.4.2", default-features = false, features = [
] }

[patch.crates-io]
cfg_aliases_0_1 = { package = "cfg_aliases", path = "crates/cfg_aliases_0_1" }
# Pinned to forked serde version since https://github.com/serde-rs/serde/pull/2513 is not merged
serde = { git = "https://github.com/HULKs/serde.git", rev = "ef30eb8fdd0ee12e4e6f3f5615c6bb022e02d1b2" }
# Pinned to forked serde version since https://github.com/serde-rs/serde/pull/2513 is not merged
Expand Down
12 changes: 9 additions & 3 deletions crates/argument_parsers/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,9 @@ pub fn parse_systemctl_action(systemctl_action: &str) -> Result<SystemctlAction>
"start" => Ok(SystemctlAction::Start),
"status" => Ok(SystemctlAction::Status),
"stop" => Ok(SystemctlAction::Stop),
_ => bail!("unexpected systemctl action"),
_ => {
bail!("unexpected systemctl action");
}
}
}

Expand Down Expand Up @@ -57,7 +59,9 @@ pub fn parse_network(network: &str) -> Result<Network> {
"HSL_I" => Ok(Network::HslI),
"HSL_J" => Ok(Network::HslJ),
"HSL_HULKs" => Ok(Network::HslHulks),
_ => bail!("unexpected network"),
_ => {
bail!("unexpected network");
}
}
}

Expand Down Expand Up @@ -209,7 +213,9 @@ fn parse_assignment(input: &str) -> Result<(&str, PlayerNumber)> {
"3" => PlayerNumber::Three,
"4" => PlayerNumber::Four,
"5" => PlayerNumber::Five,
_ => bail!("unexpected player number {player_number}"),
_ => {
bail!("unexpected player number {player_number}");
}
};
Ok((prefix, player_number))
}
Expand Down
4 changes: 2 additions & 2 deletions crates/booster/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -111,7 +111,7 @@ impl LowState {
.copied()
.collect::<Joints<MotorState>>())
} else {
bail!("failed to construct motor states")
bail!("failed to construct motor states");
}
}

Expand All @@ -123,7 +123,7 @@ impl LowState {
.copied()
.collect::<Joints<MotorState>>())
} else {
bail!("failed to construct motor states")
bail!("failed to construct motor states");
}
}
}
Expand Down
8 changes: 8 additions & 0 deletions crates/cfg_aliases_0_1/Cargo.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
[package]
name = "cfg_aliases"
version = "0.1.2"
edition = "2018"
publish = false

[dependencies]
cfg_aliases_0_2 = { package = "cfg_aliases", version = "0.2.2" }
1 change: 1 addition & 0 deletions crates/cfg_aliases_0_1/src/lib.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
pub use cfg_aliases_0_2::cfg_aliases;
Original file line number Diff line number Diff line change
Expand Up @@ -58,12 +58,16 @@ impl TryFrom<RoboCupGameControlReturnData> for GameControllerReturnMessage {
3 => PlayerNumber::Three,
4 => PlayerNumber::Four,
5 => PlayerNumber::Five,
_ => bail!("unexpected player number {}", message.playerNum),
_ => {
bail!("unexpected player number {}", message.playerNum);
}
},
fallen: match message.fallen {
1 => true,
0 => false,
_ => bail!("unexpected fallen state"),
_ => {
bail!("unexpected fallen state");
}
},
pose: Pose2::new(
point![message.pose[0] / 1000.0, message.pose[1] / 1000.0],
Expand Down
44 changes: 31 additions & 13 deletions crates/hsl_network_messages/src/game_controller_state_message.rs
Original file line number Diff line number Diff line change
Expand Up @@ -74,11 +74,13 @@ impl TryFrom<RoboCupGameControlData> for GameControllerStateMessage {
match (message.teams[0].teamNumber, message.teams[1].teamNumber) {
(HULKS_TEAM_NUMBER, _) => (0, 1),
(_, HULKS_TEAM_NUMBER) => (1, 0),
_ => bail!(
"failed to find HULKs team, teams were {:?} and {:?}",
message.teams[0],
message.teams[1]
),
_ => {
bail!(
"failed to find HULKs team, teams were {:?} and {:?}",
message.teams[0],
message.teams[1]
);
}
};
const MAXIMUM_NUMBER_OF_PENALTY_SHOOTS: u8 = 16;
if message.teams[hulks_team_index].penaltyShot >= MAXIMUM_NUMBER_OF_PENALTY_SHOOTS {
Expand Down Expand Up @@ -133,7 +135,9 @@ impl TryFrom<RoboCupGameControlData> for GameControllerStateMessage {
stopped: match message.stopped {
0 => false,
1 => true,
_ => bail!("unexpected stopped value: {}", message.stopped),
_ => {
bail!("unexpected stopped value: {}", message.stopped);
}
},
game_phase: GamePhase::try_from(message.gamePhase, message.kickingTeam)?,
game_state: GameState::try_from(message.state)?,
Expand Down Expand Up @@ -218,7 +222,9 @@ impl CompetitionType {
COMPETITION_TYPE_SMALL => Ok(CompetitionType::Small),
COMPETITION_TYPE_MIDDLE => Ok(CompetitionType::Middle),
COMPETITION_TYPE_LARGE => Ok(CompetitionType::Large),
_ => bail!("unexpected competition type"),
_ => {
bail!("unexpected competition type");
}
}
}
}
Expand Down Expand Up @@ -246,7 +252,9 @@ impl GamePhase {
GAME_PHASE_PENALTY_SHOOT_OUT => Ok(GamePhase::PenaltyShootout { kicking_team: team }),
GAME_PHASE_EXTRA_TIME => Ok(GamePhase::Extratime),
GAME_PHASE_TIMEOUT => Ok(GamePhase::Timeout),
_ => bail!("unexpected game phase"),
_ => {
bail!("unexpected game phase");
}
}
}
}
Expand All @@ -268,7 +276,9 @@ impl GameState {
STATE_SET => Ok(GameState::Set),
STATE_PLAYING => Ok(GameState::Playing),
STATE_FINISHED => Ok(GameState::Finished),
_ => bail!("unexpected game state"),
_ => {
bail!("unexpected game state");
}
}
}
}
Expand Down Expand Up @@ -315,7 +325,9 @@ impl SubState {
SET_PLAY_THROW_IN => Ok(Some(SubState::ThrowIn)),
SET_PLAY_GOAL_KICK => Ok(Some(SubState::GoalKick)),
SET_PLAY_CORNER_KICK => Ok(Some(SubState::CornerKick)),
_ => bail!("unexpected sub state"),
_ => {
bail!("unexpected sub state");
}
}
}
}
Expand All @@ -333,7 +345,9 @@ impl TryFrom<u8> for Half {
match half {
1 => Ok(Half::First),
0 => Ok(Half::Second),
_ => bail!("unexpected half"),
_ => {
bail!("unexpected half");
}
}
}
}
Expand Down Expand Up @@ -380,7 +394,9 @@ impl TryFrom<u8> for TeamColor {
TEAM_PURPLE => Ok(TeamColor::Purple),
TEAM_BROWN => Ok(TeamColor::Brown),
TEAM_GRAY => Ok(TeamColor::Gray),
_ => bail!("unexpected team color"),
_ => {
bail!("unexpected team color");
}
}
}
}
Expand Down Expand Up @@ -445,7 +461,9 @@ impl Penalty {
PENALTY_CAUTIONED => Ok(Some(Penalty::Cautioned { remaining })),
PENALTY_SENT_OFF => Ok(Some(Penalty::SentOff { remaining })),
PENALTY_SUBSTITUTE => Ok(Some(Penalty::Substitute { remaining })),
_ => bail!("unexpected penalty type"),
_ => {
bail!("unexpected penalty type");
}
}
}
}
Expand Down
2 changes: 1 addition & 1 deletion crates/nodes/booster_sdk_interface/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -655,7 +655,7 @@ async fn retryable_rpc_call<T>(
if await_rpc_call(future, operation, attempt).await.is_some() {
Ok(())
} else {
color_eyre::eyre::bail!("retryable rpc call failed")
color_eyre::eyre::bail!("retryable rpc call failed");
}
}

Expand Down
4 changes: 2 additions & 2 deletions crates/nodes/detection/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -234,7 +234,7 @@ fn extract_outputs<'a>(outputs: &'a SessionOutputs<'a>) -> Result<ModelOutputs<'
"object detection output not of expected shape. Expected: {:?}, got: {:?}",
TaskHead::ObjectDetection.expected_shape(),
objects_output.shape()
)
);
}
let reshaped_objects_output = objects_output.squeeze().into_dimensionality()?;

Expand All @@ -244,7 +244,7 @@ fn extract_outputs<'a>(outputs: &'a SessionOutputs<'a>) -> Result<ModelOutputs<'
"pose detection output not of expected shape. Expected: {:?}, got: {:?}",
TaskHead::PoseDetection.expected_shape(),
poses_output.shape()
)
);
}
let reshaped_pose_output = poses_output.squeeze().into_dimensionality()?;

Expand Down
2 changes: 1 addition & 1 deletion crates/nodes/localization-3d/src/node.rs
Original file line number Diff line number Diff line change
Expand Up @@ -240,7 +240,7 @@ pub async fn run(ctx: Arc<Context>) -> Result<()> {
}
result = &mut backend_handle => {
result.wrap_err("failed to join")?.wrap_err("solver failed")?;
bail!("solver stopped unexpectedly")
bail!("solver stopped unexpectedly");
}
result = frontend.wait_for_optimization_result() => {
result?;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -241,7 +241,9 @@ fn decode_gray_png(
.chunks_exact(4)
.map(|pixel| rgb_to_luma(pixel[0], pixel[1], pixel[2]))
.collect(),
unsupported => bail!("unsupported PNG format for {path}: {unsupported:?}"),
unsupported => {
bail!("unsupported PNG format for {path}: {unsupported:?}");
}
};

Ok(GrayImage {
Expand Down
Loading
Loading