Shop OBEX P1 Docs P2 Docs Learn Events
Original ActivityBot possible project — Parallax Forums

Original ActivityBot possible project

RsadeikaRsadeika Posts: 3,837
edited 2021-04-12 16:12 in Robotics

I am using the original Activity Board on the Bot chassis, that I have. Below is a little test program, and it comes up with an error, when compiled. Are those libs corrupted, or is there something else that should be added to the program.

Thanks Ray

/*
  ab_test1.c

*/
#include "simpletools.h" 
#include "abcalibrate.h"
#include "abdrive.h"

int main()
{
  // Add startup code here.


  while(1)
  {
    // Add main loop code here.

  }  
}

Project Directory: F:/programs/ab_test1/ab_test1/

SimpleIDE Version 1.1.2
C:/Users/ray/Documents/SimpleIDE/Learn/Simple Libraries/
C:/Users/ray/Documents/SimpleIDE/ Updated on: 2020-12-19

propeller-elf-gcc.exe -v GCC 4.6.1 (propellergcc_v1_0_0_2408)
propeller-elf-gcc.exe -I . -L . -I C:/Users/ray/Documents/SimpleIDE/Learn/Simple Libraries/Robotics/ActivityBot/libabcalibrate -L C:/Users/ray/Documents/SimpleIDE/Learn/Simple Libraries/Robotics/ActivityBot/libabcalibrate/cmm/ -I C:/Users/ray/Documents/SimpleIDE/Learn/Simple Libraries/Robotics/ActivityBot/libabdrive -L C:/Users/ray/Documents/SimpleIDE/Learn/Simple Libraries/Robotics/ActivityBot/libabdrive/cmm/ -I C:/Users/ray/Documents/SimpleIDE/Learn/Simple Libraries/Utility/libsimpletools -L C:/Users/ray/Documents/SimpleIDE/Learn/Simple Libraries/Utility/libsimpletools/cmm/ -I C:/Users/ray/Documents/SimpleIDE/Learn/Simple Libraries/TextDevices/libsimpletext -L C:/Users/ray/Documents/SimpleIDE/Learn/Simple Libraries/TextDevices/libsimpletext/cmm/ -I C:/Users/ray/Documents/SimpleIDE/Learn/Simple Libraries/Protocol/libsimplei2c -L C:/Users/ray/Documents/SimpleIDE/Learn/Simple Libraries/Protocol/libsimplei2c/cmm/ -I C:/Users/ray/Documents/SimpleIDE/Learn/Simple Libraries/Motor/libservo -L C:/Users/ray/Documents/SimpleIDE/Learn/Simple Libraries/Motor/libservo/cmm/ -I C:/Users/ray/Documents/SimpleIDE/Learn/Simple Libraries/TextDevices/libfdserial -L C:/Users/ray/Documents/SimpleIDE/Learn/Simple Libraries/TextDevices/libfdserial/cmm/ -o ab_test1.elf -Os -mcmm -m32bit-doubles -fno-exceptions -std=c99 ab_test1.c -lm -labcalibrate -labdrive -lrate -lsimpletools -lsimpletext -lsimplei2c -lservo -lfdserial -lm -labcalibrate -labdrive -lrate -lsimpletools -lsimpletext -lsimplei2c -lservo -lm -labcalibrate -labdrive -lrate -lsimpletools -lsimpletext -lsimplei2c -lm -labcalibrate -labdrive -lrate -lsimpletools -lsimpletext -lm -labcalibrate -labdrive -lrate -lsimpletools -lm -labcalibrate -labdrive -lrate -lm -labcalibrate -labdrive -lm -labcalibrate -lm
c:/program files (x86)/simpleide/propeller-gcc/bin/../lib/gcc/propeller-elf/4.6.1/../../../../propeller-elf/bin/ld.exe: cannot find -lrate
c:/program files (x86)/simpleide/propeller-gcc/bin/../lib/gcc/propeller-elf/4.6.1/../../../../propeller-elf/bin/ld.exe: cannot find -lrate
c:/program files (x86)/simpleide/propeller-gcc/bin/../lib/gcc/propeller-elf/4.6.1/../../../../propeller-elf/bin/ld.exe: cannot find -lrate
c:/program files (x86)/simpleide/propeller-gcc/bin/../lib/gcc/propeller-elf/4.6.1/../../../../propeller-elf/bin/ld.exe: cannot find -lrate
c:/program files (x86)/simpleide/propeller-gcc/bin/../lib/gcc/propeller-elf/4.6.1/../../../../propeller-elf/bin/ld.exe: cannot find -lrate
c:/program files (x86)/simpleide/propeller-gcc/bin/../lib/gcc/propeller-elf/4.6.1/../../../../propeller-elf/bin/ld.exe: cannot find -lrate
collect2: ld returned 1 exit status
Done. Build Failed!

Comments

  • Ray, do this first https://learn.parallax.com/tutorials/language/propeller-c/propeller-c-set-simpleide/update-your-learn-folder and try again.

    Also, which tutorial are you working from in this series? Seems you might be in here https://learn.parallax.com/tutorials/robot/activitybot/activitybot/navigation-basics.

    Ken Gracey

  • Ken GraceyKen Gracey Posts: 7,395
    edited 2021-04-12 16:11

    Looking at this a bit more, usually the calibrate library is used with simpletools (but not with abdrive.h, concurrently):

    // ------ Libraries and Definitions ------
    #include "simpletools.h"
    #include "abcalibrate.h"
    
    // ------ Main Program ------
    int main() {
      cal_servoPins(12, 13);
      cal_encoderPins(14, 15);
      high(26);
      high(27);
      cal_activityBot();
      low(26);
      low(27);
    }
    

    I don't know why the above text is so BOLD, either. Something about the include word.

    In your code, I see it combined with other libraries abdrive too. You might be running out of memory, too. I think the first thing to do is make sure you've got the Simple IDE workspace updated. I may not be able to return to this thread until Thursday.

    Ken Gracey

    Edit: Code block added. Include "bold" have syntax highlighting.

  • Firstly, your 'include" statements need to be '#include' :

    #include "simpletools.h"
    #include "abcalibrate.h"
    #include "abdrive.h"
    

    Fix that and it will either compile or give you a more informative error message. It appears that the "cannot find -lrate' error is because the include (and not #include) lines are being fragmented as the preprocessor tries to interpret them... The 'rate' in '-lrate' is part of 'abcalibrate'.

    dgately

  • @dgately said:
    Firstly, your 'include" statements need to be '#include' :

    #include "simpletools.h"
    #include "abcalibrate.h"
    #include "abdrive.h"
    

    Fix that and it will either compile or give you a more informative error message. It appears that the "cannot find -lrate' error is because the include (and not #include) lines are being fragmented as the preprocessor tries to interpret them... The 'rate' in '-lrate' is part of 'abcalibrate'.

    dgately

    @dgately notice my code has the same problem. This forum software is stripping out the # character in front of the include.

    Ken

  • Dennis, how do you format for code inclusion with this forum tool? I should know. . . .

    Ken Gracey

  • @"Ken Gracey" said:
    Dennis, how do you format for code inclusion with this forum tool? I should know. . . .

    Ken Gracey

    Steps:
    1. type 3 backticks
    2. type return
    3. enter my code lines (type them in or copy paste them)
    4. type return
    5. type 3 backticks
    6. type return

    // C type comment
    #include "stdio.h"
    

    It will look like this until you type return after the last 3 backticks:

    ```
    // C type comment
    #include "stdio.h"
    ```

    I did a trick by preceding the backticks & hash with a backslash in the above example just to show how it looks...

  • In my code it is "#include "simpletools.h", for some reason when I pasted the code to the post, it stripped away the "#".

    I just tried the four different Learn folders, and each one comes up with the same errors. I am using the latest SimpleIDE download, so, I am not sure what is going on.

    The SimpleIDE version that is installed, I use to program all my other programs, with no problems showing up. With that said, I think maybe the Libs are corrupted.

    Ray

  • Back to Ray's problem...

    Yes, updating SimpleIDE's Learn folder should help... I'm able to compile, with just some warnings about __simple_printf...

    Project Directory: /myUser/Desktop/
    
    SimpleIDE Version 1.1.0
    /myUser/Documents/SimpleIDE/Learn/Simple Libraries/
    /myUser/Documents/SimpleIDE/ Updated on: 2020-03-10
    
    propeller-elf-gcc -v GCC 4.6.1 (propellergcc_v1_0_0-36-g4c46ecb)
    propeller-elf-gcc -I . -L . -I /myUser/Documents/SimpleIDE/Learn/Simple Libraries/Utility/libsimpletools -L /myUser/Documents/SimpleIDE/Learn/Simple Libraries/Utility/libsimpletools/lmm/ -I /myUser/Documents/SimpleIDE/Learn/Simple Libraries/TextDevices/libsimpletext -L /myUser/Documents/SimpleIDE/Learn/Simple Libraries/TextDevices/libsimpletext/lmm/ -I /myUser/Documents/SimpleIDE/Learn/Simple Libraries/Protocol/libsimplei2c -L /myUser/Documents/SimpleIDE/Learn/Simple Libraries/Protocol/libsimplei2c/lmm/ -I /myUser/Documents/SimpleIDE/Learn/Simple Libraries/Robotics/ActivityBot/libabcalibrate -L /myUser/Documents/SimpleIDE/Learn/Simple Libraries/Robotics/ActivityBot/libabcalibrate/lmm/ -I /myUser/Documents/SimpleIDE/Learn/Simple Libraries/Motor/libservo -L /myUser/Documents/SimpleIDE/Learn/Simple Libraries/Motor/libservo/lmm/ -I /myUser/Documents/SimpleIDE/Learn/Simple Libraries/TextDevices/libfdserial -L /myUser/Documents/SimpleIDE/Learn/Simple Libraries/TextDevices/libfdserial/lmm/ -I /myUser/Documents/SimpleIDE/Learn/Simple Libraries/Robotics/ActivityBot/libabdrive -L /myUser/Documents/SimpleIDE/Learn/Simple Libraries/Robotics/ActivityBot/libabdrive/lmm/ -o raysCode.elf -Os -mlmm -m32bit-doubles -fno-exceptions -Dprintf=__simple_printf raysCode.c -lsimpletools -lsimpletext -lsimplei2c -labcalibrate -lservo -lfdserial -labdrive -lsimpletools -lsimpletext -lsimplei2c -labcalibrate -lservo -lfdserial -lsimpletools -lsimpletext -lsimplei2c -labcalibrate -lservo -lsimpletools -lsimpletext -lsimplei2c -labcalibrate -lsimpletools -lsimpletext -lsimplei2c -lsimpletools -lsimpletext -lsimpletools
    In file included from /myUser/Documents/SimpleIDE/Learn/Simple Libraries/Utility/libsimpletools/simpletools.h:118:0,
                     from raysCode.c:6:
    /myUser/Documents/SimpleIDE/Learn/Simple Libraries/TextDevices/libsimpletext/simpletext.h:309:1: warning: '__simple_printf' is an unrecognized format function type [-Wformat]
    
    propeller-load -s raysCode.elf
    propeller-elf-objdump -h raysCode.elf
    Done. Build Succeeded!
    
    
  • I downloaded and installed the latest version of SimpleIDE:
    SimpleIDE Version 1.1.2
    C:/Users/ray/Documents/SimpleIDE/Learn/Simple Libraries/
    C:/Users/ray/Documents/SimpleIDE/ Updated on: 2021-04-07
    I noticed that you are using:
    SimpleIDE Version 1.1.0
    /myUser/Documents/SimpleIDE/Learn/Simple Libraries/
    /myUser/Documents/SimpleIDE/ Updated on: 2020-03-10
    Is their some kind of difference between 1.1.0 and 1.1.2 versions. Yes, with the latest download, I am still getting those errors.

    Ray

  • dgatelydgately Posts: 1,631
    edited 2021-04-07 21:58

    @Rsadeika said:
    I downloaded and installed the latest version of SimpleIDE:
    SimpleIDE Version 1.1.2
    I noticed that you are using:
    SimpleIDE Version 1.1.0
    Is their some kind of difference between 1.1.0 and 1.1.2 versions. Yes, with the latest download, I am still getting those errors.

    Ray

    Interesting... I actually have several versions of SimpleIDE ;)

    I just downloaded the latest SimpleIDE for macOS and it is: version 1.1.0...

    I actually use a 1.0.2rc version because it allows me to use the old non-project set up as well as spin-based projects rather than just C...

  • RsadeikaRsadeika Posts: 3,837
    edited 2021-04-12 16:13

    Today I tried out the ..360 libs, I am getting the same errors. I am using a Windows 10 setup, so everything should be working as expected. It looks like the Libs are out of sync with SimpleIDE.

    I know that Parallax is pushing Blockly, but I was hoping that they would keep SimpleIDE around for a lot longer.

    Ray

    /*
      ab_test1.c
    
    */
    #include "simpletools.h" 
    #include "abcalibrate360.h"
    #include "abdrive360.h"
    
    
    
    
    
    
    
    int main()
    {
      // Add startup code here.
      //calServoPins(12,13);
      high(26);
      high(27);
      //cal_activityBot();
      low(26);
      low(27);
    
      //while(1)
      //{
        // Add main loop code here.
    
      //}  
    }
    

    Project Directory: C:/Users/ray/Documents/SimpleIDE/My Projects/ab_test1/

    SimpleIDE Version 1.1.2
    C:/Users/ray/Documents/SimpleIDE/Learn/Simple Libraries/
    C:/Users/ray/Documents/SimpleIDE/ Updated on: 2021-04-07
    
    propeller-elf-gcc.exe -v GCC 4.6.1 (propellergcc_v1_0_0_2408)
    propeller-elf-gcc.exe -I . -L . -I C:/Users/ray/Documents/SimpleIDE/Learn/Simple Libraries/Robotics/ActivityBot/libabcalibrate -L C:/Users/ray/Documents/SimpleIDE/Learn/Simple Libraries/Robotics/ActivityBot/libabcalibrate/cmm/ -I C:/Users/ray/Documents/SimpleIDE/Learn/Simple Libraries/Robotics/ActivityBot/libabdrive -L C:/Users/ray/Documents/SimpleIDE/Learn/Simple Libraries/Robotics/ActivityBot/libabdrive/cmm/ -I ./../../Learn/Simple Libraries/Robotics/ActivityBot/libabcalibrate -L ./../../Learn/Simple Libraries/Robotics/ActivityBot/libabcalibrate/cmm/ -I ./../../Learn/Simple Libraries/Robotics/ActivityBot/libabdrive -L ./../../Learn/Simple Libraries/Robotics/ActivityBot/libabdrive/cmm/ -I ./../../Learn/Simple Libraries/Robotics/ActivityBot360/libabcalibrate360 -L ./../../Learn/Simple Libraries/Robotics/ActivityBot360/libabcalibrate360/cmm/ -I ./../../Learn/Simple Libraries/Robotics/ActivityBot360/libabdrive360 -L ./../../Learn/Simple Libraries/Robotics/ActivityBot360/libabdrive360/cmm/ -I C:/Users/ray/Documents/SimpleIDE/Learn/Simple Libraries/Utility/libsimpletools -L C:/Users/ray/Documents/SimpleIDE/Learn/Simple Libraries/Utility/libsimpletools/cmm/ -I C:/Users/ray/Documents/SimpleIDE/Learn/Simple Libraries/TextDevices/libsimpletext -L C:/Users/ray/Documents/SimpleIDE/Learn/Simple Libraries/TextDevices/libsimpletext/cmm/ -I C:/Users/ray/Documents/SimpleIDE/Learn/Simple Libraries/Protocol/libsimplei2c -L C:/Users/ray/Documents/SimpleIDE/Learn/Simple Libraries/Protocol/libsimplei2c/cmm/ -I C:/Users/ray/Documents/SimpleIDE/Learn/Simple Libraries/Motor/libservo360 -L C:/Users/ray/Documents/SimpleIDE/Learn/Simple Libraries/Motor/libservo360/cmm/ -I C:/Users/ray/Documents/SimpleIDE/Learn/Simple Libraries/TextDevices/libfdserial -L C:/Users/ray/Documents/SimpleIDE/Learn/Simple Libraries/TextDevices/libfdserial/cmm/ -o cmm/ab_test1.elf -Os -mcmm -m32bit-doubles -fno-exceptions -std=c99 ab_test1.c -lm -labcalibrate -labdrive -labcalibrate360 -labdrive360 -lrate -lrate360 -lsimpletools -lsimpletext -lsimplei2c -lservo360 -lfdserial -lm -labcalibrate -labdrive -labcalibrate360 -labdrive360 -lrate -lrate360 -lsimpletools -lsimpletext -lsimplei2c -lservo360 -lm -labcalibrate -labdrive -labcalibrate360 -labdrive360 -lrate -lrate360 -lsimpletools -lsimpletext -lsimplei2c -lm -labcalibrate -labdrive -labcalibrate360 -labdrive360 -lrate -lrate360 -lsimpletools -lsimpletext -lm -labcalibrate -labdrive -labcalibrate360 -labdrive360 -lrate -lrate360 -lsimpletools -lm -labcalibrate -labdrive -labcalibrate360 -labdrive360 -lrate -lrate360 -lm -labcalibrate -labdrive -labcalibrate360 -labdrive360 -lrate -lm -labcalibrate -labdrive -labcalibrate360 -labdrive360 -lm -labcalibrate -labdrive -labcalibrate360 -lm -labcalibrate -labdrive -lm -labcalibrate -lm
    c:/program files (x86)/simpleide/propeller-gcc/bin/../lib/gcc/propeller-elf/4.6.1/../../../../propeller-elf/bin/ld.exe: cannot find -lrate
    c:/program files (x86)/simpleide/propeller-gcc/bin/../lib/gcc/propeller-elf/4.6.1/../../../../propeller-elf/bin/ld.exe: cannot find -lrate360
    c:/program files (x86)/simpleide/propeller-gcc/bin/../lib/gcc/propeller-elf/4.6.1/../../../../propeller-elf/bin/ld.exe: cannot find -lrate
    c:/program files (x86)/simpleide/propeller-gcc/bin/../lib/gcc/propeller-elf/4.6.1/../../../../propeller-elf/bin/ld.exe: cannot find -lrate360
    c:/program files (x86)/simpleide/propeller-gcc/bin/../lib/gcc/propeller-elf/4.6.1/../../../../propeller-elf/bin/ld.exe: cannot find -lrate
    c:/program files (x86)/simpleide/propeller-gcc/bin/../lib/gcc/propeller-elf/4.6.1/../../../../propeller-elf/bin/ld.exe: cannot find -lrate360
    c:/program files (x86)/simpleide/propeller-gcc/bin/../lib/gcc/propeller-elf/4.6.1/../../../../propeller-elf/bin/ld.exe: cannot find -lrate
    c:/program files (x86)/simpleide/propeller-gcc/bin/../lib/gcc/propeller-elf/4.6.1/../../../../propeller-elf/bin/ld.exe: cannot find -lrate360
    c:/program files (x86)/simpleide/propeller-gcc/bin/../lib/gcc/propeller-elf/4.6.1/../../../../propeller-elf/bin/ld.exe: cannot find -lrate
    c:/program files (x86)/simpleide/propeller-gcc/bin/../lib/gcc/propeller-elf/4.6.1/../../../../propeller-elf/bin/ld.exe: cannot find -lrate360
    c:/program files (x86)/simpleide/propeller-gcc/bin/../lib/gcc/propeller-elf/4.6.1/../../../../propeller-elf/bin/ld.exe: cannot find -lrate
    c:/program files (x86)/simpleide/propeller-gcc/bin/../lib/gcc/propeller-elf/4.6.1/../../../../propeller-elf/bin/ld.exe: cannot find -lrate360
    c:/program files (x86)/simpleide/propeller-gcc/bin/../lib/gcc/propeller-elf/4.6.1/../../../../propeller-elf/bin/ld.exe: cannot find -lrate
    collect2: ld returned 1 exit status
    Done. Build Failed!
    
  • RsadeikaRsadeika Posts: 3,837
    edited 2021-04-12 15:08

    I decided to try to move the robot around, I have fore() and back() functions. When I have just the back() alone, it goes backwards. But when I have both fore() and back(), it just goes forwards and not backwards.

    This servo stuff is all new to me. I think I prefer to work with a motor, with an h-bridge, it is quite simple to get the motor to go forwards and backwards. Since all I got on my activitybot is servos, then I guess I have to figure this stuff out. I guess the problem to solve is, why wont it go backwards right after the forward command.

    Ray

    /*
      ab_test1.c
    
    */
    #include "simpletools.h"
    #include "servo.h"
    
    
    void fore();
    void back();
    
    
    int main()
    {
      // Add startup code here.
      fore();
      pause(500);
      back();
      pause(500);
      servo_stop();   
    }
    
    void fore()
    {
      servo_setramp(12,1);
      servo_setramp(13,1);
      servo_angle(12, 0);    // Right wheel, forwards  
      servo_angle(13, 1800);   // Left wheel forwards
    }
    void back()
    {
      servo_setramp(12,1);
      servo_setramp(13,1);
      servo_angle(12,1800);   // Right wheel, backwards
      servo_angle(13,0);    // Left wheel, backwards    
    }  
    
  • You may find this all much easier if you use the SimpleIDE example code for the ActivityBot (or the ActivityBot360)... Those examples are in the SimpleIDE example file path at: "Learn/Examples/Robots/ActivityBot" or "Learn/Examples/Robots/ActivityBot360". Of course, that's the Linux/Unix/MacOS style of path naming and you'll need to use a Windows path to find them.


    The examples use much simpler methods of driving the robot's servos.

    Untested simplified example (I hope it just works). You'll need to make sure to wire the servos as the "Learning C with ActivityBot" example webpages detail:

    /*
      example.c
      Go forward, then, back up
    */
    #include "simpletools.h"                        // Include simpletools library
    #include "abdrive.h"                            // Include abdrive library
    
    int main()                                      // main function
    {
      while(1)                                      // Main loop
      {
        // Go forward for a second
        drive_speed(100, 100);                      // Go forward
        pause(1000);                                // 1 second
    
        drive_speed(-100, -100);                    // Back up 0.5 seconds
        pause(500); 
      }
    }
    

    And, read post #7 above, which details how to post code on this forum, with 3 backticks...

    dgately

  • In the sixth icon, when drop down, it gives a choice for code, and others, when you choose code, it presents two back ticks. So, I guess that is messed up, unless that is a prompt and you have to add the missing back ticks. Still trying to figure out how to do the quote thing.

    I was just experimenting with one of the Activity boards, and now I get the can not find the Prop. And all I did was mount the board on the posts and added a battery source. Time to see what else I have that works.

    Ray

  • Interesting things are going on. I installed SimpleIDE on my small Linux box and tried out the activitybot stuff from the examples folder, it sort of works. It looks like it is an older version of Learn folder, so some of this stuff tries to work.

    On the Linux box, the commands like servo_stop() are not present, so I have to acquainted with the older commands.

    I am now wondering if the SimpleIDE install process for the Windows 10 box is somehow getting corrupted. Not sure how I could narrow that down. This is more work that I had anticipated.

    Plus the the forum keeps going into the stall process,

  • I went ahead and ordered an ActivityBot Upgrade Kit, new wheels, Parallaxy kit, and some other stuff. I hope the SimpleIDE Activity360 for Win 10 gets straightened out before my stuff gets here.

    With the Parallaxy kit I will be adding some lithium battery packs that I am making up, so I can power the Activity Board, Raspberry Pi board, noir camera and other stuff. With the new wheels I hope I will be getting some consistent traction between wood floors and carpeting.

    Ray

  • @Rsadeika said:
    In the sixth icon, when drop down, it gives a choice for code, and others, when you choose code, it presents two back ticks. So, I guess that is messed up, unless that is a prompt and you have to add the missing back ticks. Still trying to figure out how to do the quote thing.

    That Code menu just allows a single line of code to be inserted... To insert multiple lines of code, you have to manually type the 3 backticks to open then 3 more to close code lines.

  • Just an update.

    I just got in my new Activity WX Board, with some other bot related things like the servo360 drives, and now the abdrive360 lib works in SimpleIDE Version 1.1.2. So, I guess those 360 libs have a problem working with the original Activity Board and the latest SimpleIDE. I guess my old Activity Boards have a limited use capacity.

    Ray
    PS Forum is starting to do its freeze up thing, time to get out.

Sign In or Register to comment.