Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

What is the correct way to install the models? #5

Closed
Jaeyoung-Lim opened this issue Apr 13, 2020 · 18 comments
Closed

What is the correct way to install the models? #5

Jaeyoung-Lim opened this issue Apr 13, 2020 · 18 comments

Comments

@Jaeyoung-Lim
Copy link
Contributor

Jaeyoung-Lim commented Apr 13, 2020

Is there a documentation on how to correctly install the models of flight gear?

1. Install FlightGear and . You should be able to run Flightgear by fgfs from command line.
2. Install required aircraft models (Rascal_110, ThunderFly TF-G1)
3. Set write permissions to the Protocol folder of FG (in ubuntu /usr/share/games/flightgear/Protocols)
4. Open QgroundControl
5. In PX4Firmware folder run: make px4_sitl_nosteplock flightgear_plane for plane or make px4_sitl_nosteplock flightgear_tf-g1 for autogyro

I was trying to get started (Haven't looked at any additional documentation) and am stuck at 2.
While I continued without doing step 2, I ran into the following message

Screenshot from 2020-04-13 17-11-15

I guess everyone else will wonder the same thing when they get started.
Thanks,

@slimonslimon
Copy link
Contributor

slimonslimon commented Apr 13, 2020

Okey.

You install FlightGear probably from the repository (most straight way). But you don't install a fg-data package. When you install it (or download it separately) FG needs to know, where this data folder is.
(probably: /usr/share/games/flightgear ) - use "choose folder" in this dialog.

Test your FG installation by running command "fgfs" - it will show this dialog, or start the game with plane Cessna.

After that you can download vehicles (link in readme) and extract downloaded zip file into Aircraft folder (probably: /usr/share/games/flightgear/Aircraft), exactly subfolder in FG-Data package

Can you tell me, what distribution and version of Linux are you using?

@Jaeyoung-Lim
Copy link
Contributor Author

Jaeyoung-Lim commented Apr 13, 2020

@slimonslimon I am using Ubuntu 18.04, and I installed flight gear through

apt install flightgear

There is no package called fg-data in apt. Where can I get fg-data?

I can certainly run fgfs. It shows me the cessna model. The dialog is shown when I run it with

make px4_sitl_nolockstep flightgear_plane

Would it be possible to maybe automate the model addition? Not sure how big of a task this is.

@slimonslimon
Copy link
Contributor

slimonslimon commented Apr 13, 2020

Automated model downloading is pending issue (i did not set up an issue on GitHub yet)

But it seems that version (FG 2018.1.1) works something in another way than I expected. (It is not complaining about the model but about whole data folder) - I will try to reproduce your error.

One other "stupid" question: do you have the latest version of the "PX4firmware - flightgear" branch? (I made today bunch update of scripts)

@slimonslimon
Copy link
Contributor

we have tested this only with FG 2019.1.1 (and 2019.2.0 - with some updates)

@slimonslimon
Copy link
Contributor

slimonslimon commented Apr 13, 2020

@kaklik can you try to reproduce this error (FG 2018.1.1 from ubuntu 18.04 repo?)

@roman-dvorak
Copy link
Member

roman-dvorak commented Apr 13, 2020

Yes, I can confirm this problem.

You must install FlightGear from FlightGear PPA. It will also install FGdata

sudo add-apt-repository ppa:saiarcot895/flightgear
sudo apt update
sudo apt install flightgear

(more information: http://wiki.flightgear.org/Howto:Install_Flightgear_from_a_PPA)_

You'll probably have to do:

sudo apt install flightgear --upgrade

@kaklik
Copy link
Member

kaklik commented Apr 13, 2020

@kaklik can you try to reproduce this error (FG 2018.1.1 from ubuntu 18.04 repo?)

I do not have any setup with this old FG version. I think we should not support it. I suggest to support at least 2019.1.1 FG version and later.

@slimonslimon
Copy link
Contributor

slimonslimon commented Apr 13, 2020

But it works correctly at FG 2016.x.x in Debian 9
I will investigate this problem tomorrow.

@Jaeyoung-Lim
Copy link
Contributor Author

@slimonslimon @kaklik @roman-dvorak Thanks!

I will try to update flightgear and try again.

@Jaeyoung-Lim
Copy link
Contributor Author

Jaeyoung-Lim commented Apr 25, 2020

@kaklik @slimonslimon @roman-dvorak I have tried the rascal vehicle with flightgear 2019.1.1 on Ubuntu bionic. Looks awesome!!

However, it results in a flyaway in misison mode. Would this be an expected outcome? Or is there something wrong on myside?
Demo

Not related to the issue above, but I think the documentation needs a bit more information. I needed to figure out a few stuff to get it running

  • This implementation doesn't support the default flight gear distributed with Ubuntu 18.04 (the standard linux distribution px4 supports)
  • You don't need to run fgfs before you run the make command
  • Installing vehicles needs more explanation on exactly how or where to put the model directories.
  • Would be nice if you also write down how to set write permissions for the Protocol directory so that other users don't do anything wrong

@kaklik
Copy link
Member

kaklik commented Apr 26, 2020

The flyaway behavior seems to be a bug of PX4. It happens in the case where you do not have any mission waypoint selected. (I do not really know how this algorithm working)

The expected and correct behavior is the following:

FlightGear SITL Plane test

Installation of models we suppose to solve by the creation of a FlightGear hangar
with vehicles adapted to UAV SITL development. There seem to be slightly different requirements than standard simulated aircraft.

The Protocol directory permissions have been resolved by recent commits to FlightGear bridge and there should be no requirement to manually change permissions.

Yes, the documentation is mainly uncomplete. We have started to make the documentation. But it will take some time to get it complete. But testing is welcomed during this period. :)

@Jaeyoung-Lim is it possible to link this issue or the pull-request from the description of your video to achieve consistency in explanation of FlightGear bridge usage?

@Jaeyoung-Lim
Copy link
Contributor Author

Jaeyoung-Lim commented Apr 26, 2020

I understand the long term goals of the nice architecture, but if I cannot run it "out of the box" following the documentation, it means not much people using px4 will struggle to run flight gear. This is a problem if we want to get the bridge merged as PX4. I don't expect the full documentation to be complete, but even the readme of this repo are missing instructions.

@kaklik I am not sure what you mean by "mission waypoint selected" the same mission works well in SITL gazebo, and it is being checked in the CI. Also, I cannot reproduce this issue in SITL gazebo. Therefore, it is highly unlikely that this is a bug of px4. Does this mean you have seen this before? How can I resolve my problem? Is it related to my setup?

The permission problems were still there with PX4/PX4-Autopilot#14539 Are you talking about a more recent branch?

I believe this issue is basically the issues I am running into by "testing" the documentation of the readme of this repo(Which is the only documentation available), which I am struggling to run properly.

@Jaeyoung-Lim
Copy link
Contributor Author

I also noticed the following errors,

ERROR [sensors] Sensor Accel #0 failed. Reconfiguring sensor priorities.
WARN  [sensors] Remaining sensors after failover event 0: Accel #0 priority: 1
WARN  [sensors] Remaining sensors after failover event 0: Accel #1 priority: 0
WARN  [sensors] Remaining sensors after failover event 0: Accel #2 priority: 0
ERROR [sensors] Gyro #0 fail:  TIMEOUT!
ERROR [sensors] Sensor Gyro #0 failed. Reconfiguring sensor priorities.
WARN  [sensors] Remaining sensors after failover event 0: Gyro #0 priority: 1
WARN  [sensors] Remaining sensors after failover event 0: Gyro #1 priority: 0
WARN  [sensors] Remaining sensors after failover event 0: Gyro #2 priority: 0

@slimonslimon
Copy link
Contributor

slimonslimon commented Apr 26, 2020

@Jaeyoung-Lim at first Thank you for your testing and suggestions. In my opinion, it is great, that you were able to set up everything and fly.

I will test the documentation today - it will be improved to be correct at ubuntu.

To your errors: What are your FPS in FlightGear? (you can display it from View->View Options-> Show frame rate)?

To the mission problem: It seems there is a problem when Take off point is on opposite side than direction of the aeroplane at the ground. But QGC shows the correct position of the plane, so I think, that PX4 knows, where the plane is but does not turn it. I don't know why?

To Flightgear version etc. It probably should work with the Distribution version, but it does not in ubuntu. I need to look deeper at this problem, but first I need to install ubuntu on my machine.

@kaklik
Copy link
Member

kaklik commented Apr 26, 2020

@Jaeyoung-Lim @slimonslimon I think it will be better if you split the discussion to several separate issues for each topics. I think this issue should be left for model installation as possible. (I want to close is as soon as I make the hangar.xml for FlightGear.)

@Jaeyoung-Lim
Copy link
Contributor Author

@slimonslimon Thanks for clarifying, indeed moving the takeoff waypoint fixed the issue.

Interestingly, this is not reproducable in SITL gazebo. The waypoint tracks properly even though the takeoff waypoint is at the back of the vehicle when armed.

@kaklik Thanks, makes sense. I will open separate issues since now I know that the whole workflow is working.

@Jaeyoung-Lim
Copy link
Contributor Author

Jaeyoung-Lim commented Apr 26, 2020

@Jaeyoung-Lim @slimonslimon I think it will be better if you split the discussion to several separate issues for each topics. I think this issue should be left for model installation as possible. (I want to close is as soon as I make the hangar.xml for FlightGear.)

@kaklik Seperated flyaway issue to #10

@slimonslimon
Copy link
Contributor

slimonslimon commented Apr 29, 2020

This base of this issue was solved by adding a folder with models (as git submodules). We found, that most models need to be somehow customised for SITL use.

Now, the bridge will have models as a subfolder and startup scripts will point FG to search vehicles in this folder.

slimonslimon added a commit that referenced this issue Jan 14, 2021
* Add simple build test with github actions

This Adds a simple build test for github actions.

* Renaming the Rascal submodule directory.

* Fix some model path.
Draft of multi-vehicle simulation init scripts.

* Disable joystick and mouse control input.

* Switch to LKSO airport.

* Update README.md

* Add note about availability of multi make target.

* Fix level of details handling for multi-vehicle simulation.

* Add TF-G2 model

* add submodule TF-G2

* Add TF-G2 autogyro model

* Update README.md

* Update submodule

* Fix typos.

* Workaround of issue #15

* Update README.md

* Switch from IgnMath to Eigen3 math library.

* Remove libignition-math4-dev from readme.

Co-authored-by: JaeyoungLim <[email protected]>
Co-authored-by: Jakub Kákona <[email protected]>
Co-authored-by: Roman Dvorak <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants