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
4 changes: 2 additions & 2 deletions Cargo.lock

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

2 changes: 1 addition & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ members = ["booster_sdk", "booster_sdk_py", "examples/rust/*"]
resolver = "2"

[workspace.package]
version = "0.1.0-alpha.11"
version = "0.1.0-alpha.12"
edition = "2024"
authors = ["Team whIRLwind"]
license = "MIT OR Apache-2.0"
Expand Down
24 changes: 24 additions & 0 deletions booster_sdk/src/client/loco.rs
Original file line number Diff line number Diff line change
Expand Up @@ -372,6 +372,30 @@ impl BoosterClient {
self.rpc.call_void(LocoApiId::ExitWbcGait, "").await
}

/// Move both hand end-effectors to target postures simultaneously.
pub async fn move_dual_hand_end_effector(
&self,
left_target_posture: &crate::types::Posture,
right_target_posture: &crate::types::Posture,
time_millis: i32,
) -> Result<()> {
let param = json!({
"left_target_posture": left_target_posture,
"right_target_posture": right_target_posture,
"time_millis": time_millis,
})
.to_string();
self.rpc
.call_void(LocoApiId::MoveDualHandEndEffector, param)
.await
}

/// Start or stop a visual kick (side-foot kick).
pub async fn visual_kick(&self, start: bool) -> Result<()> {
let param = json!({ "start": start }).to_string();
self.rpc.call_void(LocoApiId::VisualKick, param).await
}

/// Publish a raw gripper control topic message.
pub fn publish_gripper(&self, control: GripperControl) -> Result<()> {
self.gripper_publisher.write(control)
Expand Down
2 changes: 2 additions & 0 deletions booster_sdk/src/types/b1.rs
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,8 @@ crate::api_id_enum! {
UnloadCustomTrainedTraj = 2034,
EnterWbcGait = 2035,
ExitWbcGait = 2036,
MoveDualHandEndEffector = 2037,
VisualKick = 2038,
}
}

Expand Down
13 changes: 13 additions & 0 deletions booster_sdk_py/booster_sdk_bindings/booster_sdk_bindings.pyi
Original file line number Diff line number Diff line change
Expand Up @@ -1047,6 +1047,19 @@ class BoosterClient:
"""Exit WBC gait mode."""
...

def move_dual_hand_end_effector(
self,
left_target_posture: Posture,
right_target_posture: Posture,
time_millis: int,
) -> None:
"""Move both hand end-effectors to target postures simultaneously."""
...

def visual_kick(self, start: bool) -> None:
"""Start or stop a visual kick (side-foot kick)."""
...

def publish_gripper_command(self, command: GripperCommand) -> None:
"""Publish low-level gripper command message."""
...
Expand Down
27 changes: 27 additions & 0 deletions booster_sdk_py/src/client/booster.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1626,6 +1626,33 @@ impl PyBoosterClient {
wait_for_future(py, async move { client.exit_wbc_gait().await }).map_err(to_py_err)
}

fn move_dual_hand_end_effector(
&self,
py: Python<'_>,
left_target_posture: PyPosture,
right_target_posture: PyPosture,
time_millis: i32,
) -> PyResult<()> {
let client = Arc::clone(&self.client);
let left_target_posture: Posture = left_target_posture.into();
let right_target_posture: Posture = right_target_posture.into();
wait_for_future(py, async move {
client
.move_dual_hand_end_effector(
&left_target_posture,
&right_target_posture,
time_millis,
)
.await
})
.map_err(to_py_err)
}

fn visual_kick(&self, py: Python<'_>, start: bool) -> PyResult<()> {
let client = Arc::clone(&self.client);
wait_for_future(py, async move { client.visual_kick(start).await }).map_err(to_py_err)
}

fn publish_gripper_command(&self, command: PyGripperCommand) -> PyResult<()> {
let command: GripperCommand = command.into();
self.client
Expand Down
2 changes: 1 addition & 1 deletion pixi.toml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ authors = ["Team whIRLwind"]
channels = ["conda-forge"]
name = "booster-sdk"
platforms = ["osx-arm64", "linux-64", "linux-aarch64"]
version = "0.1.0-alpha.11"
version = "0.1.0-alpha.12"

[environments]
py = ["wheel-build", "python-tasks"]
Expand Down
Loading