Skip to content

Commit

Permalink
autosync
Browse files Browse the repository at this point in the history
  • Loading branch information
actions-user committed Jan 6, 2025
1 parent 96d1abc commit 64c4445
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 2 deletions.
10 changes: 10 additions & 0 deletions src/ODriveEnums.h
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,8 @@ enum ODriveAxisState {
AXIS_STATE_ENCODER_HALL_POLARITY_CALIBRATION = 12,
AXIS_STATE_ENCODER_HALL_PHASE_CALIBRATION = 13,
AXIS_STATE_ANTICOGGING_CALIBRATION = 14,
AXIS_STATE_HARMONIC_CALIBRATION = 15,
AXIS_STATE_HARMONIC_CALIBRATION_COMMUTATION = 16,
};

// ODrive.Controller.ControlMode
Expand Down Expand Up @@ -192,6 +194,14 @@ enum ODriveMotorType {
MOTOR_TYPE_ACIM = 3,
};

// ODrive.ThermistorMode
enum ODriveThermistorMode {
THERMISTOR_MODE_NTC = 1,
THERMISTOR_MODE_QUADRATIC = 2,
THERMISTOR_MODE_PT1000 = 3,
THERMISTOR_MODE_KTY84 = 4,
};

// ODrive.Can.Error
enum ODriveCanError {
CAN_ERROR_NONE = 0x00000000,
Expand Down
7 changes: 5 additions & 2 deletions src/can_simple_messages.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -179,18 +179,21 @@ struct Address_msg_t final {
void encode_buf(uint8_t* buf) const {
can_set_signal_raw<uint8_t>(buf, Node_ID, 0, 8, true);
can_set_signal_raw<uint64_t>(buf, Serial_Number, 8, 48, true);
can_set_signal_raw<uint8_t>(buf, Connection_ID, 56, 8, true);
}

void decode_buf(const uint8_t* buf) {
Node_ID = can_get_signal_raw<uint8_t>(buf, 0, 8, true);
Serial_Number = can_get_signal_raw<uint64_t>(buf, 8, 48, true);
Connection_ID = can_get_signal_raw<uint8_t>(buf, 56, 8, true);
}

static const uint8_t cmd_id = 0x006;
static const uint8_t msg_length = 8;

uint8_t Node_ID = 0;
uint64_t Serial_Number = 0;
uint8_t Connection_ID = 0;
};

struct Set_Axis_State_msg_t final {
Expand Down Expand Up @@ -325,8 +328,8 @@ struct Set_Input_Pos_msg_t final {
static const uint8_t msg_length = 8;

float Input_Pos = 0.0f; // [rev]
float Vel_FF = 0.0f; // [rev/s]
float Torque_FF = 0.0f; // [Nm]
float Vel_FF = 0.0f; // [rev/s (default) [#vel-ff-scale]_]
float Torque_FF = 0.0f; // [Nm (default) [#torque-ff-scale]_]
};

struct Set_Input_Vel_msg_t final {
Expand Down

0 comments on commit 64c4445

Please sign in to comment.