mirror of
https://github.com/odriverobotics/ODrive.git
synced 2026-08-20 22:14:34 +08:00
committed by
Paul Guenette
parent
5f9b45e080
commit
073da34a02
@@ -423,6 +423,10 @@ bool Axis::run_homing() {
|
||||
|
||||
// Set the current position to 0, the target to zero, and make sure we're path planning from 0 to 0
|
||||
encoder_.set_linear_count(0);
|
||||
const auto load_encoder_axis = controller_.config_.load_encoder_axis;
|
||||
if(load_encoder_axis != axis_num_ && load_encoder_axis < AXIS_COUNT) {
|
||||
axes[load_encoder_axis].encoder_.set_linear_count(0);
|
||||
}
|
||||
controller_.input_pos_ = 0.0f;
|
||||
controller_.pos_setpoint_ = 0.0f;
|
||||
controller_.vel_setpoint_ = 0.0f;
|
||||
|
||||
@@ -237,8 +237,8 @@ bool CANSimple::get_encoder_estimates_callback(const Axis& axis) {
|
||||
txmsg.isExt = axis.config_.can.is_extended;
|
||||
txmsg.len = 8;
|
||||
|
||||
can_setSignal<float>(txmsg, axis.encoder_.pos_estimate_.any().value_or(0.0f), 0, 32, true);
|
||||
can_setSignal<float>(txmsg, axis.encoder_.vel_estimate_.any().value_or(0.0f), 32, 32, true);
|
||||
can_setSignal<float>(txmsg, axis.controller_.pos_estimate_linear_src_.any().value_or(0.0f), 0, 32, true);
|
||||
can_setSignal<float>(txmsg, axis.controller_.vel_estimate_src_.any().value_or(0.0f), 32, 32, true);
|
||||
|
||||
return canbus_->send_message(txmsg);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user