Merge branch 'devel' into preroll

This commit is contained in:
Oskar Weigl
2018-10-06 01:48:33 -07:00
3 changed files with 16 additions and 12 deletions
+1
View File
@@ -20,6 +20,7 @@ Please add a note of your changes below this heading if you make a Pull Request.
* `encoder.config.bandwidth`
### Fixed
* An issue where the axis state machine would jump in and out of idle when there is an error
* There is a [bug](https://github.com/ARM-software/CMSIS_5/issues/267) in the arm fast math library, which gives spikes in the output of arm_cos_f32 for input values close to -pi/2. We fixed the bug locally, and hence are using "our_arm_cos_f32".
# Releases
+8 -12
View File
@@ -85,17 +85,9 @@ public:
bool do_updates();
float get_temp();
// True if there are no errors
bool inline check_for_errors() {
// Maybe we should update this to only trigger on new errors?
// The danger with that is we could fail to bail on uncleared errors that still prevent
// correct opreation.
// For now: we treat ERROR_INVALID_STATE in idle loop special, or we could never stay
// in idle after this kind of error.
if (current_state_ == AXIS_STATE_IDLE)
return (error_ & ~ERROR_INVALID_STATE) == ERROR_NONE;
else
return error_ == ERROR_NONE;
return error_ == ERROR_NONE;
}
// @brief Runs the specified update handler at the frequency of the current measurements.
@@ -127,8 +119,12 @@ public:
// Note: updates run even if checks fail
bool updates_ok = do_updates();
if (!checks_ok || !updates_ok)
break;
if (!checks_ok || !updates_ok) {
// It's not useful to quit idle since that is the safe action
// Also leaving idle would rearm the motors
if (current_state_ != AXIS_STATE_IDLE)
break;
}
// Run main loop function, defer quitting for after wait
// TODO: change arming logic to arm after waiting
+7
View File
@@ -1,6 +1,13 @@
#ifndef __ODRIVE_MAIN_H
#define __ODRIVE_MAIN_H
// Note on central include scheme by Samuel:
// there are circular dependencies between some of the header files,
// e.g. the Motor header needs a forward declaration of Axis and vice versa
// so I figured I'd make one main header that takes care of
// the forward declarations and right ordering
// btw this pattern is not so uncommon, for instance IIRC the stdlib uses it too
#ifdef __cplusplus
#include <fibre/protocol.hpp>
extern "C" {