Skip to content

Commit b005fa5

Browse files
authored
Merge pull request #4 from pollen-robotics/fix_erreur_safe_ik
error in sign
2 parents 409bb3a + 4ba5584 commit b005fa5

File tree

3 files changed

+10
-133
lines changed

3 files changed

+10
-133
lines changed

Cargo.lock

Lines changed: 7 additions & 130 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[package]
22
name = "reachy_mini_rust_kinematics"
3-
version = "1.0.2"
3+
version = "1.0.3"
44
edition = "2024"
55

66
[lib]

src/lib.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -237,21 +237,21 @@ impl Kinematics {
237237
let mut body_yaw_target = 0.0;
238238
// if body yaw is specified, rotate the platform accordingly
239239
if body_yaw.is_some() {
240-
body_yaw_target = body_yaw.unwrap();
240+
body_yaw_target = -body_yaw.unwrap();
241241
// first verify if the body yaw is within the allowed limits
242242
// relative yaw is the yaw difference between the current platform yaw and body yaw
243243
// it should stays within +/- max_relative_yaw
244244
if let Some(max_rel_yaw) = max_relative_yaw {
245245
let current_yaw = t_world_platform[(0, 1)].atan2(t_world_platform[(0, 0)]);
246246
let relative_yaw = body_yaw_target - current_yaw;
247247
body_yaw_target = current_yaw + relative_yaw.clamp(-max_rel_yaw, max_rel_yaw);
248-
body_yaw_target = -body_yaw_target;
249248
}
250249
// then clamp the body yaw within +/- max_body_yaw
251250
// this is physically limited by the mechanical design
252251
if let Some(max_body_yaw) = max_body_yaw {
253252
body_yaw_target = body_yaw_target.clamp(-max_body_yaw, max_body_yaw);
254253
}
254+
body_yaw_target = -body_yaw_target;
255255
}
256256

257257
// construct the joint angles vector

0 commit comments

Comments
 (0)