Expose individual wheel distances and requested velocities. Fix wheel distance calculation for the Create 1.
This commit is contained in:
parent
1df7861f24
commit
d6f759d683
4 changed files with 64 additions and 7 deletions
|
@ -73,8 +73,8 @@ namespace create {
|
|||
|
||||
uint32_t prevTicksLeft;
|
||||
uint32_t prevTicksRight;
|
||||
float prevLeftVel;
|
||||
float prevRightVel;
|
||||
float totalLeftDist;
|
||||
float totalRightDist;
|
||||
bool firstOnData;
|
||||
util::timestamp_t prevOnDataTime;
|
||||
|
||||
|
@ -444,6 +444,22 @@ namespace create {
|
|||
*/
|
||||
bool isMovingForward() const;
|
||||
|
||||
/* Get the total distance (in meters) the left wheel has moved.
|
||||
*/
|
||||
float getLeftWheelDistance() const;
|
||||
|
||||
/* Get the total distance (in meters) the right wheel has moved.
|
||||
*/
|
||||
float getRightWheelDistance() const;
|
||||
|
||||
/* Get the requested velocity (in meters/sec) of the left wheel.
|
||||
*/
|
||||
float getRequestedLeftWheelVel() const;
|
||||
|
||||
/* Get the requested velocity (in meters/sec) of the right wheel.
|
||||
*/
|
||||
float getRequestedRightWheelVel() const;
|
||||
|
||||
/* Get the current charging state.
|
||||
*/
|
||||
create::ChargingState getChargingState() const;
|
||||
|
|
|
@ -40,6 +40,8 @@ POSSIBILITY OF SUCH DAMAGE.
|
|||
namespace create {
|
||||
namespace util {
|
||||
|
||||
static const float CREATE_1_AXLE_LENGTH = 0.26;
|
||||
|
||||
static const uint8_t CREATE_2_HEADER = 19;
|
||||
static const float CREATE_2_AXLE_LENGTH = 0.235;
|
||||
static const float CREATE_2_TICKS_PER_REV = 508.8;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue