running the testagent

Asked by Ebrahim Bararian

i wanted to use libbats as my base.

when we run the testagent that is in example folder it shows this message:

////
ebrahim@ebrahim-laptop:~/Desktop/libbats-2.0/examples/helloworld$ ./helloworld
Socket: 4
lt-helloworld: /usr/include/eigen2/Eigen/src/Core/MatrixStorage.h:44: Eigen::ei_matrix_array<T, Size, MatrixOptions, Align>::ei_matrix_array() [with T = double, int Size = 16, int MatrixOptions = 2, bool Align = true]: Assertion `(reinterpret_cast<size_t>(array) & 0xf) == 0 && "this assertion is explained here: http://eigen.tuxfamily.org/dox/UnalignedArrayAssert.html **** READ THIS WEB PAGE !!! ****"' failed.
Aborted
////
in the mentioned link there are 4 methods to solve the problem.
but the question is "if this base code worked for the developer these 4 problems shouldn't be the case".

help me please!!

tnx in advance :)

Question information

Language:
English Edit question
Status:
Solved
For:
littlegreenbats Edit question
Assignee:
No assignee Edit question
Solved by:
Sander van Dijk
Solved:
Last query:
Last reply:
Revision history for this message
Sander van Dijk (sgvandijk) said :
#1

Indeed, this does not happen for us. Please run the agent using gdb:

$ gdb

This starts gdb, you get a (gdb) prompt. Tell it to run the agent (the actual binary should be in .libs):

(gdb) run .libs/helloworld

After you get the error mentioned above, get a back trace and please report the output you get here:

(gdb) backtrace

Revision history for this message
Ebrahim Bararian (ebrahim-bararian) said :
#2

is ./libs a folder?
where is it?

On Tue, Oct 5, 2010 at 2:24 PM, Sander van Dijk <
<email address hidden>> wrote:

> Your question #127973 on littlegreenbats changed:
> https://answers.launchpad.net/littlegreenbats/+question/127973
>
> Status: Open => Needs information
>
> Sander van Dijk requested for more information:
> Indeed, this does not happen for us. Please run the agent using gdb:
>
> $ gdb
>
> This starts gdb, you get a (gdb) prompt. Tell it to run the agent (the
> actual binary should be in .libs):
>
> (gdb) run .libs/helloworld
>
> After you get the error mentioned above, get a back trace and please
> report the output you get here:
>
> (gdb) backtrace
>
> --
> To answer this request for more information, you can either reply to
> this email or enter your reply at the following page:
> https://answers.launchpad.net/littlegreenbats/+question/127973
>
> You received this question notification because you are a direct
> subscriber of the question.
>

Revision history for this message
Sander van Dijk (sgvandijk) said :
#3

Yes, it is a directory, in the examples/helloworld directory. You can see it by running 'ls -a' in examples/helloworld.
So, start gdb in examples/helloworld. Then you can first try (don't type '(gdb)'):

(gdb) run ./helloworld

But that will most likely give a 'No executable file specified.' error, since helloworld is just a shell script that runs .libs/helloworld. The following then must work:

(gdb) examples/helloworld

Revision history for this message
Sander van Dijk (sgvandijk) said :
#4

Sorry, the last should be:

(gdb) run .libs/helloworld

Revision history for this message
Ebrahim Bararian (ebrahim-bararian) said :
#5

ebrahim@ebrahim-laptop:~/Desktop/libbats-2.0/examples/helloworld$ gdb
GNU gdb (GDB) 7.0-ubuntu
Copyright (C) 2009 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html
>
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law. Type "show copying"
and "show warranty" for details.
This GDB was configured as "i486-linux-gnu".
For bug reporting instructions, please see:
<http://www.gnu.org/software/gdb/bugs/>.
(gdb) run .libs/helloworld
Starting program: .libs/helloworld
No executable file specified.
Use the "file" or "exec-file" command.
(gdb)

Revision history for this message
Sander van Dijk (sgvandijk) said :
#6

Please try

(gdb) run ./helloworld

instead afterall then. If that gives a 'no executable file' error too, try to first run helloworld withouth gdb:

$ ./helloworld

And after that try to run .libs/helloworld with gdb. If that fails, try to run .libs/lt-helloworld. Finally, if that fails, please run:

$ ls -a | xargs ls -a

And report the output here.

Revision history for this message
Ebrahim Bararian (ebrahim-bararian) said :
#7

> Sander van Dijk posted a new comment:
> Please try
>
> (gdb) run ./helloworld
>
> failed

> instead afterall then. If that gives a 'no executable file' error too,
> try to first run helloworld withouth gdb:
>
> $ ./helloworld
>
>
output:
ebrahim@ebrahim-laptop:~/Desktop/libbats-2.0/examples/helloworld$
./helloworld
Socket: 4
terminate called after throwing an instance of 'std::runtime_error'
  what(): Connection refused
Aborted

> And after that try to run .libs/helloworld with gdb. If that fails, try
>

this is the same.

> to run .libs/lt-helloworld. Finally, if that fails, please run:
>

No executable file specified.
Use the "file" or "exec-file" command.

>
> $ ls -a | xargs ls -a
>
> And report the output here.
>

ebrahim@ebrahim-laptop:~/Desktop/libbats-2.0/examples/helloworld$ ls -a |
xargs ls -a
helloworld helloworld.o Makefile Makefile.in
helloworld.cc init.o Makefile.am think.o

.:
. .deps HelloWorldAgent helloworld.o .libs Makefile.am think.o
.. helloworld helloworld.cc init.o Makefile Makefile.in

..:
. .. helloworld Makefile Makefile.am Makefile.in

.deps:
. .. helloworld.Po init.Po think.Po

HelloWorldAgent:
. .. helloworldagent.hh helloworldagent.ih init.cc think.cc

.libs:
. .. helloworld lt-helloworld

Revision history for this message
Sander van Dijk (sgvandijk) said :
#8

The agent can't connect to the rcsserver, make sure it is running, run .libs/helloworld with gdb, wait until it crashes, and get the backtrace.

Revision history for this message
Ebrahim Bararian (ebrahim-bararian) said :
#9

U were right but this doesn't work too.

(gdb) run .libs/helloworld
Starting program: .libs/helloworld
No executable file specified.
Use the "file" or "exec-file" command.

Revision history for this message
Ebrahim Bararian (ebrahim-bararian) said :
#10

i can't understand why gdb doesn't work with the helloworld & lt-...
see these commands!!!

ebrahim@ebrahim-laptop:~/Desktop/libbats-2.0/examples/helloworld/.libs$
chmod a+x lt-helloworld
ebrahim@ebrahim-laptop:~/Desktop/libbats-2.0/examples/helloworld/.libs$
./lt-helloworld
Socket: 4
lt-helloworld: /usr/include/eigen2/Eigen/src/Core/MatrixStorage.h:44:
Eigen::ei_matrix_array<T, Size, MatrixOptions, Align>::ei_matrix_array()
[with T = double, int Size = 16, int MatrixOptions = 2, bool Align = true]:
Assertion `(reinterpret_cast<size_t>(array) & 0xf) == 0 && "this assertion
is explained here: http://eigen.tuxfamily.org/dox/UnalignedArrayAssert.html
**** READ THIS WEB PAGE !!! ****"' failed.
Aborted
ebrahim@ebrahim-laptop:~/Desktop/libbats-2.0/examples/helloworld/.libs$ gdb
GNU gdb (GDB) 7.0-ubuntu
Copyright (C) 2009 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html
>
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law. Type "show copying"
and "show warranty" for details.
This GDB was configured as "i486-linux-gnu".
For bug reporting instructions, please see:
<http://www.gnu.org/software/gdb/bugs/>.
(gdb) run helloworld
Starting program: helloworld
No executable file specified.
Use the "file" or "exec-file" command.
(gdb)

Revision history for this message
Ebrahim Bararian (ebrahim-bararian) said :
#11

no other idea?!

Revision history for this message
Ebrahim Bararian (ebrahim-bararian) said :
#12

can U send me an eclipse project that builds testagent???

tnx in advance :)

Revision history for this message
Ebrahim Bararian (ebrahim-bararian) said :
#13

hello
it apears that I have problem with Eigen library.
please give me the link of the Eigen library that is compatible with libbats
2.0!!
tnx in advance!!!

Revision history for this message
Ebrahim Bararian (ebrahim-bararian) said :
#14

this is the backtrace that you asked me for.

ebrahim@ebrahim-laptop:~/Desktop/ebrahim/libbats-2.0/examples/helloworld/libs$
gdb lt-helloworld
GNU gdb (GDB) 7.1-ubuntu
Copyright (C) 2010 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html
>
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law. Type "show copying"
and "show warranty" for details.
This GDB was configured as "i486-linux-gnu".
For bug reporting instructions, please see:
<http://www.gnu.org/software/gdb/bugs/>...
Reading symbols from
/home/ebrahim/Desktop/ebrahim/libbats-2.0/examples/helloworld/libs/lt-helloworld...done.
(gdb) run
Starting program:
/home/ebrahim/Desktop/ebrahim/libbats-2.0/examples/helloworld/libs/lt-helloworld

Socket: 6
lt-helloworld: /usr/include/eigen2/Eigen/src/Core/MatrixStorage.h:44:
Eigen::ei_matrix_array<T, Size, MatrixOptions, Align>::ei_matrix_array()
[with T = double, int Size = 16, int MatrixOptions = 2, bool Align = true]:
Assertion `(reinterpret_cast<std::size_t>(array) & 0xf) == 0 && "this
assertion is explained here:
http://eigen.tuxfamily.org/dox/UnalignedArrayAssert.html **** READ THIS WEB
PAGE !!! ****"' failed.

Program received signal SIGABRT, Aborted.
0x0012d422 in __kernel_vsyscall ()
(gdb) bt
#0 0x0012d422 in __kernel_vsyscall ()
#1 0x0048e651 in raise () from /lib/tls/i686/cmov/libc.so.6
#2 0x00491a82 in abort () from /lib/tls/i686/cmov/libc.so.6
#3 0x00487718 in __assert_fail () from /lib/tls/i686/cmov/libc.so.6
#4 0x001af91a in ei_matrix_array (this=0x8068f58)
    at /usr/include/eigen2/Eigen/src/Core/MatrixStorage.h:43
#5 ei_matrix_storage (this=0x8068f58)
    at /usr/include/eigen2/Eigen/src/Core/MatrixStorage.h:76
#6 Matrix (this=0x8068f58) at
/usr/include/eigen2/Eigen/src/Core/Matrix.h:309
#7 Transform (this=0x8068f58)
    at /usr/include/eigen2/Eigen/src/Geometry/Transform.h:96
#8 SimpleLocalizer (this=0x8068f58)
    at Localizer/SimpleLocalizer/SimpleLocalizer.cc:3
#9 0x0804925d in initialize<bats::SimpleLocalizer> (this=0xbffff340)
    at
HelloWorldAgent/../../../HumanoidAgent/../SocketComm/AgentSocketComm/../../Singleton/singleton.hh:105
#10 HelloWorldAgent::init (this=0xbffff340) at HelloWorldAgent/init.cc:6
#11 0x0019830d in bats::HumanoidAgent::run (this=0xbffff340)
    at HumanoidAgent/run.cc:57
#12 0x0804a16a in main () at helloworld.cc:6
(gdb)

Revision history for this message
Best Sander van Dijk (sgvandijk) said :
#15

The backtrace shows the problem is in SimpleLocalizer. It can be solved by adding the following line in the public section of Localizer/SimpleLocalizer/simplelocalizer.hh (for instance at line 101):

      EIGEN_MAKE_ALIGNED_OPERATOR_NEW

However, it is probably better to use the KalmanLocalizer instead of SimpleLocalizer instead. For this, change:

  SLocalizer::initialize<SimpleLocalizer>();

To

  SLocalizer::initialize<KalmanLocalizer>();

in examples/helloworld/HelloWorldAgent/init.cc. I have made these changes to the bzr head now.

About the other questions: we don't use Eclipse, so can't help you with that, or any other specific development system. The latest stable version of Eigen (http://eigen.tuxfamily.org/index.php?title=Main_Page#Download) works with libbats.

Revision history for this message
Ebrahim Bararian (ebrahim-bararian) said :
#16

Thanks Sander van Dijk, that solved my question.

Revision history for this message
Ebrahim Bararian (ebrahim-bararian) said :
#17

tnx a lot!

On Sat, Oct 9, 2010 at 11:35 PM, Sander van Dijk <
<email address hidden>> wrote:

> Your question #127973 on littlegreenbats changed:
> https://answers.launchpad.net/littlegreenbats/+question/127973
>
> Status: Open => Answered
>
> Sander van Dijk proposed the following answer:
> The backtrace shows the problem is in SimpleLocalizer. It can be solved
> by adding the following line in the public section of
> Localizer/SimpleLocalizer/simplelocalizer.hh (for instance at line 101):
>
> EIGEN_MAKE_ALIGNED_OPERATOR_NEW
>
> However, it is probably better to use the KalmanLocalizer instead of
> SimpleLocalizer instead. For this, change:
>
> SLocalizer::initialize<SimpleLocalizer>();
>
> To
>
> SLocalizer::initialize<KalmanLocalizer>();
>
> in examples/helloworld/HelloWorldAgent/init.cc. I have made these
> changes to the bzr head now.
>
> About the other questions: we don't use Eclipse, so can't help you with
> that, or any other specific development system. The latest stable
> version of Eigen
> (http://eigen.tuxfamily.org/index.php?title=Main_Page#Download) works
> with libbats.
>
> --
> If this answers your question, please go to the following page to let us
> know that it is solved:
>
> https://answers.launchpad.net/littlegreenbats/+question/127973/+confirm?answer_id=14
>
> If you still need help, you can reply to this email or go to the
> following page to enter your feedback:
> https://answers.launchpad.net/littlegreenbats/+question/127973
>
> You received this question notification because you are a direct
> subscriber of the question.
>