Error running sim_posix_revolution on ubuntu linux

114 views
Skip to first unread message

amma...@gmail.com

unread,
Jan 28, 2014, 3:26:35 AM1/28/14
to phoeni...@googlegroups.com
Hello!
I'm only starting working with TauLabs project. I've been observing Open Pilot project and now I wish run it on stm32f3discovery board. I've already ordered board, but it is still wasn't delivered. Now  I wish to test TauLabs project in simulator instead of waiting delivery.
I've pulled the latest sources from github, I have build sim_posix_revolution target. But it fails on running:

/build/sim_posix_revolution/sim_posix_revolution.elf
Running as PID: 30522
Timer Resolution for Run TimeStats is 100 ticks per second.
Unable to initialize flash posix simulator: -1
Ошибка сегментирования (сделан дамп памяти)


The last string means segmentation fault. Well, what am I doing wrong? Is it possible to run SiTL/HiTL simulation just like in Open Pilot project?

peabody124

unread,
Jan 28, 2014, 6:41:07 PM1/28/14
to phoeni...@googlegroups.com
Ah I know what causes that - you need a file of the right size called "theflash.bin" in the directory you are running from. To make it easy I have uploaded one here. https://dl.dropboxusercontent.com/u/6645063/theflash.bin

Bonus points for anyone that makes it automatically create one in the firmware code (the unit tests do this).

amma...@gmail.com

unread,
Jan 29, 2014, 1:37:51 AM1/29/14
to phoeni...@googlegroups.com
Thank you for your answer!
Got some progress, but it is still fails on running with another error. Here the listing:


Running as PID: 1560

Timer Resolution for Run TimeStats is 100 ticks per second.
udp dev 0 - socket 4 opened - result 0
Watchdog fired!
PIOS: LED 1 status 1
PIOS: LED 0 status 1

SIGFPE received.  OMG!  Math Bug!  Run again with gdb to find your mistake.



среда, 29 января 2014 г., 3:41:07 UTC+4 пользователь peabody124 написал:

José Eduardo S. C. Xavier

unread,
Jan 29, 2014, 4:03:57 AM1/29/14
to amma...@gmail.com, phoeni...@googlegroups.com
Run it with gdb and after program stop look at the backtrace.
--
You received this message because you are subscribed to the Google Groups "phoenixpilot" group.
To unsubscribe from this group and stop receiving emails from it, send an email to phoenixpilot...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.

amma...@gmail.com

unread,
Jan 29, 2014, 9:44:14 AM1/29/14
to phoeni...@googlegroups.com, amma...@gmail.com
Well, looks like I've found the problem.

There is a piece of code:

<------><------><------>float mag_len = sqrtf(mag.x * mag.x + mag.y * mag.y + mag.z * mag.z);
<------><------><------>if (mag_len){ //this line was added
<------><------><------><------>mag.x /= mag_len;
<------><------><------><------>mag.y /= mag_len;
<------><------><------><------>mag.z /= mag_len;
<------><------><------>}//this line was added
in file TauLabs/flight/Modules/Attitude/attitude.c in function updateAttitudeComplementary. mag_len variable is zero by some reasons. Because of division by zero SIGFPE signal was thrown. I've added extra if construction. Now the program runs, but it still doesn't works properly. There aren't opened ports when sim_posix_revolution.elf is running. And by this reason GCS have no connection with .elf program.

Any ideas?

amma...@gmail.com

unread,
Jan 30, 2014, 9:00:03 AM1/30/14
to phoeni...@googlegroups.com, amma...@gmail.com
I've got some more progress!
Now it was more simple. sim_posix_revolution.elf was opening the tcp socket on port 9000 for telemetry connection.

But I can't run SiTL again! Now I can run the .elf file, I can run GCS and i can establish connection between .elf and GCS, I can even launch FlightGear Flight Simulator. But I can't control aircraft. CheckBoxes in ControllGadget is disabled. It would be great to hear any ideas about it.

Also I wonder should I make contribution in sim_posix_revoulution source code to fix SIGFPE signal problem? Did I fixed it correctly? Maybe somebody of developers could answer my questions? :)

James Cotton

unread,
Jan 30, 2014, 10:58:25 AM1/30/14
to amma...@gmail.com, phoeni...@googlegroups.com

If you create a PR that gives us a good way of looking at your changes and giving feedback.

I can't remember if Linux now runs the built in simulator. Set the type to fixed wing and restart the Sim. Then see if the gyros have any data and if it is moving.

--

peabody124

unread,
Feb 1, 2014, 6:33:07 AM2/1/14
to phoeni...@googlegroups.com, amma...@gmail.com
Some things to make it easier are in this PR: https://github.com/TauLabs/TauLabs/pull/1097

The built in fixed wing simulator runs after configuring for fixed wing, but I haven't tested using an external simulator in a long time.

amma...@gmail.com

unread,
Feb 4, 2014, 8:07:04 AM2/4/14
to phoeni...@googlegroups.com, amma...@gmail.com
Some more news from me.

I've got TauLabs GCS, stm32f3discovery and FlightGear Flight Simulator. Looks like it works well. I can see data from sensors in GCS whithout simulator, and i can see telemetry data from simulator when it runs. I can drive aircraft directly from simulator, but i can't drive it via GCS. I've tried to install aerosimRC 3.8.1 and test it with GCS, but nothing figured out. So it would be great to here some ideas about it.
Also i need some tx/rx device for telemetry, instead of OPLink modem. Now i think it could be apc220. is there anything else that works with f3 discovery without any problems?


peabody124, i misunderstand you about PR. Sorry, I've never used git before. What is the PR? :)

Roman BARTHELEMY

unread,
Feb 5, 2014, 4:28:42 PM2/5/14
to phoeni...@googlegroups.com
hello,
did the try, you'll have to remove that line in simulator.cpp :

setupOutputObject(manCtrlCommand, settings.minOutputPeriod);

don't know why yet, but if you let it, no command is going to the simulator.

After that you'll have other math error coming, but I didn't found them all by now.

amma...@gmail.com

unread,
Feb 6, 2014, 8:49:55 AM2/6/14
to phoeni...@googlegroups.com
Роман, ты по-русски разговариваешь? :) Спасибо за наводку, попробую поковырять исходники еще, отпишусь :) Ну и на всякий случай...
=========================================================================================
I'm gonna try, thank you.

Roman BARTHELEMY

unread,
Feb 6, 2014, 9:49:51 AM2/6/14
to phoeni...@googlegroups.com

No, I'm not speaking russian, but Google translate is my friend ;)
 

amma...@gmail.com

unread,
Feb 6, 2014, 3:44:45 PM2/6/14
to phoeni...@googlegroups.com
Oh, sorry, your name and surname made me think that you are russian speaking person :)

четверг, 6 февраля 2014 г., 18:49:51 UTC+4 пользователь Roman BARTHELEMY написал:

peabody124

unread,
Feb 10, 2014, 6:35:15 AM2/10/14
to phoeni...@googlegroups.com, amma...@gmail.com
To drive from GCS you should have to only do two things:

1. in Preferences -> Controller enable "Allow control of GCS Receiver". This settings is buried because if you accidentally did this while flying you would have a very bad day
2. In the controller widget then select "Take control".

At this point you should see the input configuration set up to take all of the channels from "GCS Reciever". You should see the GCSReceivre object being updated and ManualControl should show it is connected.

Roman BARTHELEMY

unread,
Feb 11, 2014, 3:23:19 AM2/11/14
to phoeni...@googlegroups.com, amma...@gmail.com
hello,
I've got Xplane9 runing with HITL and SITL but I had to comment the manualcontrol as output line in simulator.cpp to have it to work.

look like the board coudn't write the manualcontrolcommand object needed by xplane.

amma...@gmail.com

unread,
Feb 11, 2014, 8:13:03 AM2/11/14
to phoeni...@googlegroups.com, amma...@gmail.com
Maybe the problem is that GCS and the board have different versions of UAVObjects? I see this warning each time running the GCS.

Roman BARTHELEMY

unread,
Feb 11, 2014, 8:18:37 AM2/11/14
to phoeni...@googlegroups.com
Nop, my sim_posix build is the same git hash as my gcs, and I had to do this trick.
Now it is working really fine for me, can do some path following using the sim_posix_revolution and xplane, But I had to turn off all of the interrupt telling me there is math bugs, I need to spend some time cleaning the path following code from all of these bugs...
You'll see that the mag_len bug is just one of them... ;)
Reply all
Reply to author
Forward
0 new messages