Discussion about development tools and environments, such as STLink, OpenOCD, arm-gcc, Eclipse, Qt Creator and Visual Studio.

HITL Simulation

User avatar
User

shred

Posts

287

Joined

Fri Mar 14, 2014 11:50 am

HITL Simulation

by shred » Thu Oct 09, 2014 12:09 pm

I have been playing around with HITL simulation. I got it working using FlightGear 3.0 on Linux, but some things are unclear to me, so I thought I start a thread about it.

First, what should be configured on the FC? FlightGear seems to start with a Cesna by default. Does this mean I have to configure the FC as fixed wing? Or is it possible to e.g. configure the FC for a quadcopter and have FlightGear simulate a quadcopter?

Second, if I enable, e.g., simulated GPS messages in the HiTL configuration, do I need to enable the corresponding module on the FC?

Third, is it possible to use my RC transmitter connected to the FC to control the simulation? There is an option to map transmitter commands from the hardware to the simulator, but this doesn't seem to have an effect.

I think HITL is a really cool feature and it could be very useful for development. Especially for someone like me who lives in a city where it is "difficult" to fly without traveling far ;)
User avatar
User

jhitesma

Posts

132

Joined

Tue Sep 30, 2014 8:14 am

Location

Yuma, AZ - USA

Re: HITL Simulation

by jhitesma » Thu Oct 09, 2014 4:29 pm

I'm dying to try HITL and have many of the same questions...but haven't been able to get it working at all yet. Though I suspect my issue is due to being on a windows Vista machine based on the googling I've done. (It just gives an error about no such file when trying to start FG even though the path is correct.)

I've also been meaning to mention that in GCS from the latest jenkins next build the config screen is all messed up below the scroll. I'll try and get a screen shot to show what's happening later today.

My other question is in the setup there are two HITL configs for different simulators. But I can't figure out how to choose which one is being used. I ended up just deleting one to make sure the one I was dealing with would be used, but I'm curious how that's supposed to work.
User avatar
User

shred

Posts

287

Joined

Fri Mar 14, 2014 11:50 am

Re: HITL Simulation

by shred » Thu Oct 09, 2014 10:53 pm

I made some progress with the FlightGear HITL simulation. One problem I discovered was that the velocity was wrong, see fix in PR1352.

Another problem that I haven't been able to fix so far is that the UAV position does not change, even though the GPS location is updating. In the HITL configuration, I selected to send the ground truth and GPS position from the simulator to the UAV and I tried different navigation filter (None, Raw, INS). Sometimes, PositionActual is updating, until the UAV is e.g. 1km from the home position, but then the position "snaps back" to zero and stays there. Any ideas what could be causing this?
User avatar
User

peabody124

Posts

1339

Joined

Tue Feb 18, 2014 12:33 pm

Re: HITL Simulation

by peabody124 » Sun Oct 12, 2014 6:37 pm

Can you record a log from the GCS with this happening? I don't have time to set up FlightGear right now but that might let me see what is happening.
User avatar
User

shred

Posts

287

Joined

Fri Mar 14, 2014 11:50 am

Re: HITL Simulation

by shred » Mon Oct 13, 2014 2:23 pm

I experimented with HITL a bit more, and I found a setting that somewhat works, i.e., the position and attitude in the FC reflect those in FlightGear. I set "Attitude Algorithm: Complementary" and "Navigation Algorithm : Raw" together with these settings:

hitl.png
hitl.png (100.22 KiB) Viewed 2036 times


The baro altitude still doesn't work and it is grayed-out in the HITL configuration for some reason. I will look into this further. Also, the location doesn't update correctly when the "INS" navigation algorithm is used (I tried sending the raw gyro data to the FC, but it didn't help).

Who is online

Users browsing this forum: No registered users and 1 guest

Powered by phpBB ® | phpBB3 Style by KomiDesign
cron