Skip to content

Commit af7b308

Browse files
authored
Extend actuator state response (#62)
* extend actuator state response * bump version * fixed enumeration * make torque_enabled optional * make torque_enabled optional
1 parent 4a61e69 commit af7b308

File tree

5 files changed

+39
-11
lines changed

5 files changed

+39
-11
lines changed

Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ members = [
77
]
88

99
[workspace.package]
10-
version = "0.7.9"
10+
version = "0.7.10"
1111
authors = [
1212
"Benjamin Bolte <ben@kscale.dev>",
1313
"Denys Bezmenov <denys@kscale.dev>",

kos-py/pykos/__init__.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
"""KOS Python client."""
22

3-
__version__ = "0.7.9"
3+
__version__ = "0.7.10"
44

55
from . import services
66
from .client import KOS

kos-stub/src/actuator.rs

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -126,6 +126,13 @@ impl Actuator for StubActuator {
126126
voltage: Some(0.0),
127127
current: Some(0.0),
128128
faults: vec![],
129+
torque_enabled: Some(true),
130+
min_position: Some(-180.0),
131+
max_position: Some(180.0),
132+
kp: Some(1.0),
133+
kd: Some(0.1),
134+
ki: Some(0.01),
135+
max_torque: Some(5.0),
129136
}])
130137
}
131138

kos/proto/kos/actuator.proto

Lines changed: 16 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -98,15 +98,22 @@ message GetActuatorsStateResponse {
9898

9999
// State information for a single actuator.
100100
message ActuatorStateResponse {
101-
uint32 actuator_id = 1; // Actuator ID
102-
bool online = 2; // Online status
103-
optional double position = 3; // Position in degrees
104-
optional double velocity = 4; // Velocity in degrees/second
105-
optional double torque = 5; // Torque in Nm
106-
optional double temperature = 6; // Temperature in Celsius
107-
optional float voltage = 7; // Voltage in volts
108-
optional float current = 8; // Current in amperes
109-
repeated string faults = 9; // Faults
101+
uint32 actuator_id = 1; // Actuator ID
102+
bool online = 2; // Online status
103+
optional double position = 3; // Position in degrees
104+
optional double velocity = 4; // Velocity in degrees/second
105+
optional double torque = 5; // Torque in Nm
106+
optional double temperature = 6; // Temperature in Celsius
107+
optional float voltage = 7; // Voltage in volts
108+
optional float current = 8; // Current in amperes
109+
repeated string faults = 9; // Faults
110+
optional bool torque_enabled = 10; // Torque Enabled
111+
optional double min_position = 11; // Minimum position limit in degrees
112+
optional double max_position = 12; // Maximum position limit in degrees
113+
optional double kp = 13; // Proportional gain
114+
optional double kd = 14; // Derivative gain
115+
optional double ki = 15; // Integral gain
116+
optional double max_torque = 16; // Maximum torque limit in Nm
110117
}
111118

112119
message ParameterDumpRequest {

kos/src/telemetry_types.rs

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -43,6 +43,13 @@ pub struct ActuatorState {
4343
pub temperature: Option<f64>,
4444
pub voltage: Option<f32>,
4545
pub current: Option<f32>,
46+
pub torque_enabled: Option<bool>,
47+
pub min_position: Option<f64>,
48+
pub max_position: Option<f64>,
49+
pub kp: Option<f64>,
50+
pub kd: Option<f64>,
51+
pub ki: Option<f64>,
52+
pub max_torque: Option<f64>,
4653
}
4754

4855
#[derive(Clone, Debug, Serialize)]
@@ -102,6 +109,13 @@ impl From<&ActuatorStateResponse> for ActuatorState {
102109
temperature: resp.temperature,
103110
voltage: resp.voltage,
104111
current: resp.current,
112+
torque_enabled: resp.torque_enabled,
113+
min_position: resp.min_position,
114+
max_position: resp.max_position,
115+
kp: resp.kp,
116+
kd: resp.kd,
117+
ki: resp.ki,
118+
max_torque: resp.max_torque,
105119
}
106120
}
107121
}

0 commit comments

Comments
 (0)