From 8b851c57546e896006e4979c73ac890e34db9a82 Mon Sep 17 00:00:00 2001 From: nfreq <190794310+nfreq@users.noreply.github.com> Date: Sat, 24 May 2025 18:40:04 -0700 Subject: [PATCH 1/5] extend actuator state response --- kos-stub/src/actuator.rs | 7 +++++++ kos/proto/kos/actuator.proto | 25 ++++++++++++++++--------- kos/src/telemetry_types.rs | 14 ++++++++++++++ 3 files changed, 37 insertions(+), 9 deletions(-) diff --git a/kos-stub/src/actuator.rs b/kos-stub/src/actuator.rs index d1a047f..d48f0ad 100644 --- a/kos-stub/src/actuator.rs +++ b/kos-stub/src/actuator.rs @@ -126,6 +126,13 @@ impl Actuator for StubActuator { voltage: Some(0.0), current: Some(0.0), faults: vec![], + torque_enabled: true, + min_position: Some(-180.0), + max_position: Some(180.0), + kp: Some(1.0), + kd: Some(0.1), + ki: Some(0.01), + max_torque: Some(5.0), }]) } diff --git a/kos/proto/kos/actuator.proto b/kos/proto/kos/actuator.proto index 91c524a..7017a13 100644 --- a/kos/proto/kos/actuator.proto +++ b/kos/proto/kos/actuator.proto @@ -98,15 +98,22 @@ message GetActuatorsStateResponse { // State information for a single actuator. message ActuatorStateResponse { - uint32 actuator_id = 1; // Actuator ID - bool online = 2; // Online status - optional double position = 3; // Position in degrees - optional double velocity = 4; // Velocity in degrees/second - optional double torque = 5; // Torque in Nm - optional double temperature = 6; // Temperature in Celsius - optional float voltage = 7; // Voltage in volts - optional float current = 8; // Current in amperes - repeated string faults = 9; // Faults + uint32 actuator_id = 1; // Actuator ID + bool online = 2; // Online status + optional double position = 3; // Position in degrees + optional double velocity = 4; // Velocity in degrees/second + optional double torque = 5; // Torque in Nm + optional double temperature = 6; // Temperature in Celsius + optional float voltage = 7; // Voltage in volts + optional float current = 8; // Current in amperes + repeated string faults = 9; // Faults + bool torque_enabled = 2; // Torque Enabled + optional double min_position = 10; // Minimum position limit in degrees + optional double max_position = 11; // Maximum position limit in degrees + optional double kp = 12; // Proportional gain + optional double kd = 13; // Derivative gain + optional double ki = 14; // Integral gain + optional double max_torque = 15; // Maximum torque limit in Nm } message ParameterDumpRequest { diff --git a/kos/src/telemetry_types.rs b/kos/src/telemetry_types.rs index 0024480..90690c9 100644 --- a/kos/src/telemetry_types.rs +++ b/kos/src/telemetry_types.rs @@ -43,6 +43,13 @@ pub struct ActuatorState { pub temperature: Option, pub voltage: Option, pub current: Option, + pub torque_enabled: bool, + pub min_position: Option, + pub max_position: Option, + pub kp: Option, + pub kd: Option, + pub ki: Option, + pub max_torque: Option, } #[derive(Clone, Debug, Serialize)] @@ -102,6 +109,13 @@ impl From<&ActuatorStateResponse> for ActuatorState { temperature: resp.temperature, voltage: resp.voltage, current: resp.current, + torque_enabled: resp.torque_enabled, + min_position: resp.min_position, + max_position: resp.max_position, + kp: resp.kp, + kd: resp.kd, + ki: resp.ki, + max_torque: resp.max_torque, } } } From fda4b18cfed8682eff4cde6fec105445607ee6bb Mon Sep 17 00:00:00 2001 From: nfreq <190794310+nfreq@users.noreply.github.com> Date: Sat, 24 May 2025 18:40:55 -0700 Subject: [PATCH 2/5] bump version --- Cargo.toml | 2 +- kos-py/pykos/__init__.py | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/Cargo.toml b/Cargo.toml index 67114ab..c270d82 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -7,7 +7,7 @@ members = [ ] [workspace.package] -version = "0.7.9" +version = "0.7.10" authors = [ "Benjamin Bolte ", "Denys Bezmenov ", diff --git a/kos-py/pykos/__init__.py b/kos-py/pykos/__init__.py index c77043f..95709c1 100644 --- a/kos-py/pykos/__init__.py +++ b/kos-py/pykos/__init__.py @@ -1,6 +1,6 @@ """KOS Python client.""" -__version__ = "0.7.9" +__version__ = "0.7.10" from . import services from .client import KOS From 15ae6001fe5e1e25bde98b5ee567174a2e2507b0 Mon Sep 17 00:00:00 2001 From: nfreq <190794310+nfreq@users.noreply.github.com> Date: Sat, 24 May 2025 21:48:04 -0400 Subject: [PATCH 3/5] fixed enumeration --- kos/proto/kos/actuator.proto | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/kos/proto/kos/actuator.proto b/kos/proto/kos/actuator.proto index 7017a13..d1d27c6 100644 --- a/kos/proto/kos/actuator.proto +++ b/kos/proto/kos/actuator.proto @@ -107,13 +107,13 @@ message ActuatorStateResponse { optional float voltage = 7; // Voltage in volts optional float current = 8; // Current in amperes repeated string faults = 9; // Faults - bool torque_enabled = 2; // Torque Enabled - optional double min_position = 10; // Minimum position limit in degrees - optional double max_position = 11; // Maximum position limit in degrees - optional double kp = 12; // Proportional gain - optional double kd = 13; // Derivative gain - optional double ki = 14; // Integral gain - optional double max_torque = 15; // Maximum torque limit in Nm + bool torque_enabled = 10; // Torque Enabled + optional double min_position = 11; // Minimum position limit in degrees + optional double max_position = 12; // Maximum position limit in degrees + optional double kp = 13; // Proportional gain + optional double kd = 14; // Derivative gain + optional double ki = 15; // Integral gain + optional double max_torque = 16; // Maximum torque limit in Nm } message ParameterDumpRequest { From df97c652ed718c5f33ab44602f60f8a5e95c94f5 Mon Sep 17 00:00:00 2001 From: nfreq <190794310+nfreq@users.noreply.github.com> Date: Sat, 24 May 2025 22:26:57 -0400 Subject: [PATCH 4/5] make torque_enabled optional --- kos/proto/kos/actuator.proto | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/kos/proto/kos/actuator.proto b/kos/proto/kos/actuator.proto index d1d27c6..7b7c9bc 100644 --- a/kos/proto/kos/actuator.proto +++ b/kos/proto/kos/actuator.proto @@ -107,7 +107,7 @@ message ActuatorStateResponse { optional float voltage = 7; // Voltage in volts optional float current = 8; // Current in amperes repeated string faults = 9; // Faults - bool torque_enabled = 10; // Torque Enabled + optional bool torque_enabled = 10; // Torque Enabled optional double min_position = 11; // Minimum position limit in degrees optional double max_position = 12; // Maximum position limit in degrees optional double kp = 13; // Proportional gain From 86bcf3ece4f9cbd315e44a964f1a3bd9195935dc Mon Sep 17 00:00:00 2001 From: nfreq <190794310+nfreq@users.noreply.github.com> Date: Sat, 24 May 2025 22:29:18 -0400 Subject: [PATCH 5/5] make torque_enabled optional --- kos-stub/src/actuator.rs | 2 +- kos/src/telemetry_types.rs | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/kos-stub/src/actuator.rs b/kos-stub/src/actuator.rs index d48f0ad..4bf6e75 100644 --- a/kos-stub/src/actuator.rs +++ b/kos-stub/src/actuator.rs @@ -126,7 +126,7 @@ impl Actuator for StubActuator { voltage: Some(0.0), current: Some(0.0), faults: vec![], - torque_enabled: true, + torque_enabled: Some(true), min_position: Some(-180.0), max_position: Some(180.0), kp: Some(1.0), diff --git a/kos/src/telemetry_types.rs b/kos/src/telemetry_types.rs index 90690c9..0fb26bc 100644 --- a/kos/src/telemetry_types.rs +++ b/kos/src/telemetry_types.rs @@ -43,7 +43,7 @@ pub struct ActuatorState { pub temperature: Option, pub voltage: Option, pub current: Option, - pub torque_enabled: bool, + pub torque_enabled: Option, pub min_position: Option, pub max_position: Option, pub kp: Option,