mirror of
https://github.com/odriverobotics/ODrive.git
synced 2026-09-21 23:44:48 +08:00
added control mode setters (current and velocity)
This commit is contained in:
@@ -46,6 +46,14 @@ void ODriveArduino::TrapezoidalMove(int motor_number, float position){
|
||||
serial_ << "t " << motor_number << " " << position << "\n";
|
||||
}
|
||||
|
||||
void ODriveArduino::SetControlModeCurrent(int motor_number){
|
||||
serial_<< "w axis" << motor_number << ".controller.config.control_mode " << 1 << "\n";
|
||||
}
|
||||
|
||||
void ODriveArduino::SetControlModeVelocity(int motor_number){
|
||||
serial_<< "w axis" << motor_number << ".controller.config.control_mode " << 2 << "\n";
|
||||
}
|
||||
|
||||
float ODriveArduino::readFloat() {
|
||||
return readString().toFloat();
|
||||
}
|
||||
|
||||
@@ -28,6 +28,8 @@ public:
|
||||
void SetVelocity(int motor_number, float velocity, float current_feedforward);
|
||||
void SetCurrent(int motor_number, float current);
|
||||
void TrapezoidalMove(int motor_number, float position);
|
||||
void SetControlModeCurrent(int motor_number);
|
||||
void SetControlModeVelocity(int motor_number);
|
||||
// General params
|
||||
float readFloat();
|
||||
int32_t readInt();
|
||||
|
||||
Reference in New Issue
Block a user