Author Topic: Using Eclipse to programme Khepera IV  (Read 2928 times)

rish

  • Full Member
  • ***
  • Posts: 11
  • Karma: +0/-0
Using Eclipse to programme Khepera IV
« on: February 16, 2016, 11:06:17 AM »
Hi, I've just started using KheperaIV robots for my experimental research work. I am trying to use Eclipse as source code editor. I've followed section 5.2.2.2 to install Eclipse (Eclipse Mars) and proceeded with the rest of the instruction.

However, I encounter an error at step 18 which is to execute a "Build-All" command of the source code from step 17. The error is shown as below:

make all
Building file: ../test.c
Invoking: Cross GCC Compiler
/usr/local/khepera4-oetools/tmp/sysroots/i686-linux/usr/armv7a/bin/arm-angstrom-linux-gnueabi-gcc -I/usr/local/khepera4-oetools/tmp/sysroots/i686-linux/usr/include -O0 -g3 -Wall -c -march=armv7-a, - mtune=cortex-a8 -Wa,-mcpu=cortex-a8 -MMD -MP -MF"test.d" -MT"test.o" -o "test.o" "../test.c"
arm-angstrom-linux-gnueabi-gcc: mtune=cortex-a8: No such file or directory
arm-angstrom-linux-gnueabi-gcc: cannot specify -o with -c or -S with multiple files
make: *** [test.o] Error 1

I was trying to build a simple code to check if the linking in the previous steps work. The codes I was using is:

# include <khepera/khepera.h>
# include <stdlib.h>
# include <stdio.h>

int main ()
{
   int rc;
//   kb_set_debug_level(2);
   printf("LibKhepera Template Program\r\n");

/*   if ((rc=kb_init(argc, argv))<0) {
      return 1;
   }*/
   return 0;
}

I am guessing the error is related to step 8 of section 5.2.2.2 as the error mentions "mtune=cortex-a8" but I am not sure. Can anyone help with this?

rish

  • Full Member
  • ***
  • Posts: 11
  • Karma: +0/-0
Re: Using Eclipse to programme Khepera IV
« Reply #1 on: February 18, 2016, 07:11:16 AM »
Managed to solve the issue after a few trial and error sessions.

Step 8 from section 5.2.2.2 need to be careful coded into the properties section of the project as:

-c -march=armv7-a -mtune=cortex-a8 -Wa,-mcpu=cortex-a8

I added an extra space since there was a break in the line from the manual. This caused the error.

With that, now back to programming codes for the robots.

Any can point the direction to where I can find the Braitenberg obstacle avoidance sample c-codes?
« Last Edit: February 18, 2016, 08:37:51 AM by rish »

kteam

  • Administrator
  • Hero Member
  • *****
  • Posts: 378
  • Karma: +7/-1
Re: Using Eclipse to programme Khepera IV
« Reply #2 on: March 07, 2016, 09:51:19 AM »
Hi,

the sample code for braitenberg is include in the Khepera4_test.c file (located in the libkorebot, under /src/test).

best regards
K-Team