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

Add SITL target for starting airsim #14497

Closed
wants to merge 1 commit into from
Closed

Conversation

Jaeyoung-Lim
Copy link
Member

@Jaeyoung-Lim Jaeyoung-Lim commented Mar 26, 2020

Describe problem solved by this pull request
Previously, to run Airsim with PX4 SITL both simulations need to be run separately. The steps involve multiple steps and creates confusion always when starting / closing each processes on multiple terminals.

Also, since SITL is run completely independent of Airsim, it is hard to enforce which models were supported or not. Currently only the iris model is supported.

Describe your solution
This PR sets a make target that automatically starts Airsim when it is stored somewhere as a package. The procedure is as the following.

  • Down the latest Linux distribution and one of the environments of Airsim: link Lets assume, we have downloaded the most simple Blocks environment
  • Extract the zip file
  • Run the following command to specify the runscript
export AIRSIM_APPLICATION_PATH=<path_to_blocks>/Blocks/Blocks.sh
  • Run the following target to start airsim and px4 sitl
make px4_sitl airsim_iris

Additional context
The latest Airsim release does not include the latest lockstep fixes, therefore we need to wait for a new release from the Airsim side. Expected ETA <1 week as of microsoft/AirSim#2477

@hamishwillee
Copy link
Contributor

hamishwillee commented Mar 26, 2020

That's cool. Does this work on all platforms - and what happens if it is not supported/available?

We should add this information to:

We also need to make it clear that the simulation is very heavyweight.

@Jaeyoung-Lim @julianoes We currently link to "external" instructions in http://dev.px4.io/master/en/simulation/airsim.html
Is this working for us/is it time to move these into our own instructions.

New link? https://microsoft.github.io/AirSim/px4_sitl/

@Jaeyoung-Lim
Copy link
Member Author

@hamishwillee I believe so, but it would be dependent on what gets released on the Airsim side.

Once Airsim has a new release and we can check that it is functional, we should move the instructions internally. I guess the instructions are external because we never wrote it down properly?

@hamishwillee
Copy link
Contributor

Once Airsim has a new release and we can check that it is functional, we should move the instructions internally. I guess the instructions are external because we never wrote it down properly?

The instructions are external because it was developed by microsoft and it was never clear how the work would be maintained. That kind of still isn't clear. If we're going to support this, is there any way to get some basic testing done on CI (e.g. just to check that it can be set up and build successfully?)

@bkueng
Copy link
Member

bkueng commented Mar 27, 2020

  • What is the restarting / ctrl-c behavior? Is there a way to restart px4 w/o restarting the heavy-weight simulator?
  • Shouldn't startup also update the json config file?

@Jaeyoung-Lim
Copy link
Member Author

@bkueng

  • ctrl-c closes both px4 and airsim. Would it be possible to restart only px4 without affecting the simulator?
  • Since this is running a binary release, we don't need to configure the json file

@Jaeyoung-Lim
Copy link
Member Author

@hamishwillee I think thats a good point. We should definitely check this in CI. I will see what we can do about this. I think just checking if upstream master works with Airsim properly will be enough

@bkueng
Copy link
Member

bkueng commented Mar 27, 2020

Would it be possible to restart only px4 without affecting the simulator?

That's what I'm asking you. The simulator needs to handle it. As it's a TCP connection, it knows then the px4 goes down.

Since this is running a binary release, we don't need to configure the json file

Ok, so changing to a HIL config would not be possible either?

@hamishwillee
Copy link
Contributor

OK, keep me posted re CI. I'll try track this and think about docs when it is done. Feel free to ping me though in case I miss it.

@julianoes
Copy link
Contributor

@Jaeyoung-Lim this is cool but I'm concerned because the airsim releases on GitHub are outdated and don't support lockstep. The Linux one is so old it crashes due to a "wrong" mavlink message. If we are to support that we also need to have builds or build instructions available, right?

@bys1123
Copy link
Contributor

bys1123 commented Apr 1, 2020

@julianoes good news, AirSim 1.3.0 just released.

@bys1123
Copy link
Contributor

bys1123 commented Apr 1, 2020

Looking forward airsim_px4_vision

@Jaeyoung-Lim
Copy link
Member Author

@bys1123 Airsim can only support one airframe, which is mapped to iris. This is a limitation coming from airsim

@bys1123
Copy link
Contributor

bys1123 commented Apr 1, 2020

Thanks for explains.

@julianoes
Copy link
Contributor

@julianoes good news, AirSim 1.3.0 just released.

Oh that's awesome!

@bys1123
Copy link
Contributor

bys1123 commented Apr 1, 2020

image
This link is broken, should be https://microsoft.github.io/AirSim/px4_sitl/ now.

@hamishwillee
Copy link
Contributor

@Jaeyoung-Lim Are you saying we need to update our links to Airsim docs to https://microsoft.github.io/AirSim/px4_sitl/ "now"? Irrespective of other changes in this PR?

@bys1123
Copy link
Contributor

bys1123 commented Apr 2, 2020

@hamishwillee microsoft/AirSim#2507 . Not related other changes I guess.

@bys1123
Copy link
Contributor

bys1123 commented Apr 6, 2020

I’m trying to run PX4 1.11 (w/ cygwin toolchain) + AirSim 1.3.0 on windows
I got this waring:

pxh> WARN [commander] Takeoff denied! Please disarm and retry
WARN [PreFlightCheck] Preflight Fail: Compass Sensor #0 missing
WARN [PreFlightCheck] Primary compass not found
WARN [PreFlightCheck] Preflight Fail: Accel Sensor #0 missing
WARN [PreFlightCheck] Primary accelerometer not found
WARN [PreFlightCheck] Preflight Fail: Gyro Sensor #0 missing
WARN [PreFlightCheck] Primary gyro not found
WARN [PreFlightCheck] Preflight Fail: Baro Sensor #0 missing

my settings.json:

{
   "SettingsVersion": 1.2,
   "SimMode": "Multirotor",
   "Vehicles": {
       "PX4": {
           "VehicleType": "PX4Multirotor",
           "UseSerial": false,
           "UseTcp": true,
           "TcpPort": 4560,
           "ControlPort": 14580,
           "params": {
               "NAV_RCL_ACT": 0,
               "NAV_DLL_ACT": 0,
               "LPE_LAT": 47.641468,
               "LPE_LON": -122.140165,
               "COM_OBL_ACT": 1
           }
       }
   }
}

@Jaeyoung-Lim
Copy link
Member Author

@bys1123 I believe that the issue is caused by PX4/PX4-SITL_gazebo-classic#411
The multirate sensor publishing should be added to the Airisim side

This adds a simple way to start a px4 sitl instance together with a unreal airsim environment through a make command.

This requires a airsim binary that is released
@Jaeyoung-Lim Jaeyoung-Lim marked this pull request as ready for review May 1, 2020 12:11
@Jaeyoung-Lim
Copy link
Member Author

Closing as stale

@LorenzMeier LorenzMeier deleted the pr-sim-airsim branch January 18, 2021 14:35
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants