Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Makes NaoControl message stiffness floppy by default #63

Merged
merged 1 commit into from
Mar 21, 2024
Merged
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
24 changes: 21 additions & 3 deletions nidhogg/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -42,8 +42,8 @@ pub use error::{Error, Result};
use nidhogg_derive::Builder;
use serde::Serialize;
use types::{
color::RgbF32, Battery, ForceSensitiveResistors, JointArray, LeftEar, LeftEye, RightEar,
RightEye, Skull, SonarEnabled, SonarValues, Touch, Vector2, Vector3,
color::RgbF32, Battery, FillExt, ForceSensitiveResistors, JointArray, LeftEar, LeftEye,
RightEar, RightEye, Skull, SonarEnabled, SonarValues, Touch, Vector2, Vector3,
};

/// Generic backend trait used for implementing a NAO interface.
Expand Down Expand Up @@ -153,7 +153,7 @@ pub struct NaoState {
}

/// High level representation of the `LoLA` update message.
#[derive(Builder, Clone, Debug, Default)]
#[derive(Builder, Clone, Debug)]
pub struct NaoControlMessage {
pub position: JointArray<f32>,
pub stiffness: JointArray<f32>,
Expand All @@ -173,6 +173,24 @@ pub struct NaoControlMessage {
pub skull: Skull,
}

impl Default for NaoControlMessage {
fn default() -> Self {
Self {
position: JointArray::fill(-1.0),
stiffness: JointArray::default(),
sonar: SonarEnabled::default(),
left_ear: LeftEar::default(),
right_ear: RightEar::default(),
chest: RgbF32::default(),
left_eye: LeftEye::default(),
right_eye: RightEye::default(),
left_foot: RgbF32::default(),
right_foot: RgbF32::default(),
skull: Skull::default(),
}
}
}

/// Struct containing the hardware identifiers for the NAO V6 robot.
#[derive(Debug)]
pub struct HardwareInfo {
Expand Down
Loading