Shop OBEX P1 Docs P2 Docs Learn Events
Activity bot abdrive.h encoder questions — Parallax Forums

Activity bot abdrive.h encoder questions

Ray0665Ray0665 Posts: 231
edited 2013-09-30 11:03 in Robotics


void drive_getTicksMeasured


(.text+0x145): undefined reference to `_drive_getTicksMeasured'
note the underscore in front of drive not sure if it is me or a library problem.
I keep getting the above error from the following source code

drive_getTicksMeasured(&L_ticks, &R_ticks); /* get encoder readings since last sample*/
can anyone help?

Also what is the difference between the above routine and this one?
void drive_getTicksCalc

Comments

  • dgatelydgately Posts: 1,630
    edited 2013-09-27 13:11
    Looks like those functions have not been coded yet (in the most recent ActivityBot library, version: ActivityBot 2013-09-03b-1). Though they are declared in "../SimpleIDE/Learn/Simple\ Libraries/ActivityBot/lbabdrive/abdrive.h"... (excuse the Unix/Linux/Mac OS X path naming if you are a Windows user)


    Looking inside "../SimpleIDE/Learn/Simple\ Libraries/ActivityBot/lbabdrive/abdrive.c", you will not 'yet' find those functions.


    ActivityBot libraries are in-progress at this time, but I'm sure Parallax folks will read this post and advise. :innocent:


    The descriptions of these functions can be found in the HTML-based documentation that you'll also find inside the Simple Libraries directory with a path similar to: "../SimpleIDE/Learn/Simple\ Libraries/ActivityBot/Documentation\ abdrive\ Library.html".


    dgately
  • edited 2013-09-30 11:03
    Hello Ray0665,

    Thanks for asking. Those features are not yet implemented yet, but should be in the next version of abdrive (coming soon). My To-Do list is in the details section of ...\Documents\SimpleIDE\Learn\Simple Libraries\ActivityBot 2013-09-03b\Documentation abdrive Library.html.

    For now, if you want to get the current encoder ticks count, use void drive_getTicks(int *left, int *right).

    The abdrive control system compares the calculated distance to the measured distance and updates the servo output 50 times per second. The drive_getTicksCalc function will load the calculated number of ticks (target position) into the variables whose pointers you pass. Then, drive_getTicksMeasured, which is currently drive_getTicks, retuns the measured number of ticks.
    int leftDist, rightDist;
    ...
    drive_getTicks(&leftDist, &rightDist);
    print("leftDist = %d, rightDist = %d\n", leftDist, rightDist);
    

    Andy
Sign In or Register to comment.