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

PX4 in SITL #2647

Closed
johan606303 opened this issue May 1, 2020 · 20 comments
Closed

PX4 in SITL #2647

johan606303 opened this issue May 1, 2020 · 20 comments

Comments

@johan606303
Copy link

Hi.
I am trying to set PX4 in SITL mode.
The commands : git checkout v1.10.1 and git checkout v1.10.2 .
So I tried with git checkout v1.11.0-beta1 and I arrived to :
px4_1

So after I modified Settings.json :

px4_2

But when I run a project, run-console.bat returns the following issues :
px4_5
And on UE4 I have the following messages :
px4_3
What do I have to do else to control the drone using Python ?

Thanks for your help.

@rajat2004
Copy link
Contributor

Are you running the latest AirSim master? If not, then try with that, several issues with PX4 have been fixed very recently

@johan606303
Copy link
Author

Do you mean run the command git rebase origin/master ?

@rajat2004
Copy link
Contributor

git fetch origin
git rebase origin/master

@johan606303
Copy link
Author

johan606303 commented May 1, 2020

Well I ran those commands, it returned to me :
px4_6

So the issue is a bit different. But I forgot to mention that when I run a project, when UE4 appear and I press Play, VS2019 says that i meant breakpoints
1st picture
px4_7

And when I clic continue :
px4_8

@rajat2004
Copy link
Contributor

You might be running into the problem discussed in #2583
@lovettchris would have a better idea
Just to confirm, you're not running in HITL and only SITL correct? Also, are you using any joystick?

@johan606303
Copy link
Author

It's for SITL, and I don't use joystics, I don't have any remote controle. I want to controle just through executing codes, at least for now.

@rajat2004
Copy link
Contributor

Just to check if the current latest master is being used, could you put the last commit id
git log should give the list of commits

Also, did you run build.cmd and then update_from_git.bat to update the plugin

@lovettchris
Copy link
Member

The heap corruption in AirSim was fixed with this PR #2634, can you make sure you have those bits installed ? I built this fix into these binaries, and I've tested those binaries with PX4 v1.11.0-beta1:

I also see in your screen shot where it talks about lighting needs to be rebuilt, so I wonder if Unreal is still compiling shaders in the background, which could create some timing problems... My pre-compiled binaries will not have that problem. This shows a python script flying the above AirSim Neighborhood using PX4 SITL v1.11.0-beta1:

image

@johan606303
Copy link
Author

johan606303 commented May 2, 2020

@rajat2004 When I run git log I have :

px4_9

@johan606303
Copy link
Author

johan606303 commented May 2, 2020

Well I ran commands build.cmd, and update_from_git.bat. Then when I ran the project Blocks, here there are no breakpoints but on PX4 run-console.bat I have :
px4_13

and on UE4 :

px4_12
Then if I try to run api armDisarm(True)
px4_15

and on UE4 I have :

px4_14

@bys1123
Copy link
Contributor

bys1123 commented May 2, 2020

@lovettchris Thanks, I'll test these binary.

@johan606303
Copy link
Author

@bys1123 Hi, does it work for you ?

@bys1123
Copy link
Contributor

bys1123 commented May 4, 2020

#2649
@johan606303 Not yet, here is new PR and new binaries, might works.

@johan606303
Copy link
Author

Ok, thank you for the link.

@johan606303
Copy link
Author

johan606303 commented May 4, 2020

@lovettchris Ok. I tried to run with Blocks or Neighborhoood, that @bys1123 sent me. But I still have those issues, and I con't understand why. On run-console.bat :

px4_22

Thank you for explanation and help.
and on VS 2019 when I try to run some API python commands, it sends me an exception :

px4_21

Something is wrong with the GPS, but I defined them in settings.json as on tutorial :

px4_23

Or running PX4 in SITL rearly requires to connect and exterior device ?

Or is there a parameter that is missing, perhaps : LPE_ALT. Because I have just noticed that are indicated parameters LPE_LAT (for latitude), LPE_LON (for longitude), but not altitude.

Thank you for explanation and help.

@bys1123
Copy link
Contributor

bys1123 commented May 16, 2020

image
@johan606303 I failed too.

@johan606303
Copy link
Author

@bys1123 Ok. If I find something, I will tell you.

@DanielGilo
Copy link

I'm facing similar issues, are there any updates?

@lovettchris
Copy link
Member

Note that there are 2 PX4 messages you should be looking for:

INFO  [ecl/EKF] 3859668: EKF GPS checks passed (WGS-84 origin set)
INFO  [ecl/EKF] 8418081: EKF commencing GPS fusion

The first one does not mean it is ready to fly. The second one means AirSIm can fly, and in AirSim you should see an additional message saying "Got a home GPS location". AirSim cannot fly until this happens. Sometimes this second message takes a while depending on PX4. You can also try setting the following using the PX4 console window just in case:

param set LPE_LAT 47.641468
param set LPE_LON -122.140165
param set COM_OBL_ACT 1
param set NAV_RCL_ACT 0
param set NAV_DLL_ACT 0

just paste that block into PX4 console window and hit enter. The AirSim settings.json file should be doing this but just in case it isn't, succeeding in passing those settings to PX4, doing it manually should also help.

@jonyMarino
Copy link
Collaborator

Please try our new version which has many updates for px4.
Closed due to age.
Please feel free to open a new issue (referring to this one) if you still have this problem.
Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

6 participants