ardupilot icon indicating copy to clipboard operation
ardupilot copied to clipboard

Enable FlightGear view in sim_vehicle.py (#26540)

Open ugol-1 opened this issue 1 year ago • 10 comments

Fixes #26540

ugol-1 avatar Mar 16 '24 15:03 ugol-1

we will need a new sim_vehicle.py command line option, and update the wiki docs

tridge avatar Mar 18 '24 20:03 tridge

Was this ever completed? In short, can we, or can we not integrate FlightGear with ArduPilot and Mission Planner? The documentation found here: https://ardupilot.org/dev/docs/setting-up-sitl-on-linux.html#start-sitl-simulator does not mention FlightGear is no longer an option. Any help on this would be greatly appreciated, and I appreciate all of your hard work on the repo.

justin-slattery avatar May 29 '24 15:05 justin-slattery

@ugol-1 are you going to implement that command-line option? Looks like there's interest in fixing the fgview stuff.

peterbarker avatar Jun 05 '24 00:06 peterbarker

@ugol-1 are you going to implement that command-line option? Looks like there's interest in fixing the fgview stuff.

I can do this, yes.

ugol-1 avatar Jun 06 '24 07:06 ugol-1

@ugol-1 are you going to implement that command-line option? Looks like there's interest in fixing the fgview stuff.

I can do this, yes.

I would be immensely grateful for this, so please and thank you if you can do this! My team and I are working on the ArduPilot suite, and we would greatly benefit from having the FG visualization alongside Mission Planner.

justin-slattery avatar Jun 06 '24 14:06 justin-slattery

Hi all. Just checking back in to see if there is or can be a projected timeline for this commit? As mentioned, my team and I are actively working on development in this space and would greatly benefit from having the FG visualization available again. I have attempted to adjust the code locally but created more issues than I solved, so I was hoping this could be pushed through soon.

Alternatively, if there is a local side 'fix' that someone could walk me through, I would be more than happy to implement that while the commit is being processed/accepted. As before, we greatly appreciate all of your hard work on ArduPilot, and I appreciate the continued responsiveness of those here. Thanks!

justin-slattery avatar Jun 18 '24 18:06 justin-slattery

Hi all. Just checking back in to see if there is or can be a projected timeline for this commit? As mentioned, my team and I are actively working on development in this space and would greatly benefit from having the FG visualization available again. I have attempted to adjust the code locally but created more issues than I solved, so I was hoping this could be pushed through soon.

Alternatively, if there is a local side 'fix' that someone could walk me through, I would be more than happy to implement that while the commit is being processed/accepted. As before, we greatly appreciate all of your hard work on ArduPilot, and I appreciate the continued responsiveness of those here. Thanks!

Hello @justin-slattery , I am not an ArduPilot developer/maintainer, I am just an ordinary guy like probably you are ) If you just want a quick fix then simply apply this PR. @tridge believes that to properly fix the issue an extra option needs to be added to sim_vehicle.py, which must be pretty easy, but ArduPilot is not my main project, and I will make it when I have time, so I can not promise anything, sorry.

But again, if you just want to make FG work again -- this is a matter of adding 1 line, which is this PR. It is just adding one extra option --enable-fgview to arduplane or arducopter command line. If you run it directly (without sim_vehicle.py), all you need to do is add this option.

ugol-1 avatar Jun 22 '24 09:06 ugol-1

Hi all. Just checking back in to see if there is or can be a projected timeline for this commit? As mentioned, my team and I are actively working on development in this space and would greatly benefit from having the FG visualization available again. I have attempted to adjust the code locally but created more issues than I solved, so I was hoping this could be pushed through soon. Alternatively, if there is a local side 'fix' that someone could walk me through, I would be more than happy to implement that while the commit is being processed/accepted. As before, we greatly appreciate all of your hard work on ArduPilot, and I appreciate the continued responsiveness of those here. Thanks!

Hello @justin-slattery , I am not an ArduPilot developer/maintainer, I am just an ordinary guy like probably you are ) If you just want a quick fix then simply apply this PR. @tridge believes that to properly fix the issue an extra option needs to be added to sim_vehicle.py, which must be pretty easy, but ArduPilot is not my main project, and I will make it when I have time, so I can not promise anything, sorry.

But again, if you just want to make FG work again -- this is a matter of adding 1 line, which is this PR. It is just adding one extra option --enable-fgview to arduplane or arducopter command line. If you run it directly (without sim_vehicle.py), all you need to do is add this option.

Hi all. Just checking back in to see if there is or can be a projected timeline for this commit? As mentioned, my team and I are actively working on development in this space and would greatly benefit from having the FG visualization available again. I have attempted to adjust the code locally but created more issues than I solved, so I was hoping this could be pushed through soon. Alternatively, if there is a local side 'fix' that someone could walk me through, I would be more than happy to implement that while the commit is being processed/accepted. As before, we greatly appreciate all of your hard work on ArduPilot, and I appreciate the continued responsiveness of those here. Thanks!

Hello @justin-slattery , I am not an ArduPilot developer/maintainer, I am just an ordinary guy like probably you are ) If you just want a quick fix then simply apply this PR. @tridge believes that to properly fix the issue an extra option needs to be added to sim_vehicle.py, which must be pretty easy, but ArduPilot is not my main project, and I will make it when I have time, so I can not promise anything, sorry.

But again, if you just want to make FG work again -- this is a matter of adding 1 line, which is this PR. It is just adding one extra option --enable-fgview to arduplane or arducopter command line. If you run it directly (without sim_vehicle.py), all you need to do is add this option.

Hi all,

Updating here. First off, thanks very much for the continued conversation here. I managed to implement the fix for anyone who wants to do this locally:

in sim_vehicle.py, add the following at line 837:

    if opts.enable_fgview:
        cmd.append("--enable-fgview")

Then, at line 1346, which is within the parse options for simulation, add the following:

group_sim.add_option("--enable-fgview",
                     action='store_true',
                     default=False,
                     help="Enable FlightGear view")

This will allow you to add --enable-fgview in your sim_vehicle.py command line call, and with fg running, it will visualize your vehicle's simulation properly.

justin-slattery avatar Jun 24 '24 15:06 justin-slattery

Updating here. First off, thanks very much for the continued conversation here. I managed to implement the fix for anyone who wants to do this locally:

in sim_vehicle.py, add the following at line 837:

    if opts.enable_fgview:
        cmd.append("--enable-fgview")

Then, at line 1346, which is within the parse options for simulation, add the following:

group_sim.add_option("--enable-fgview",
                     action='store_true',
                     default=False,
                     help="Enable FlightGear view")

This will allow you to add --enable-fgview in your sim_vehicle.py command line call, and with fg running, it will visualize your vehicle's simulation properly.

Thank you for your fix @justin-slattery ! I have added it in this commit: b1fb4f340a51e8463074520b469e41331e6813b7

@tridge the option to enable FlightGear view has been added to sim_vehicle.py thanks to @justin-slattery . Please take another look.

ugol-1 avatar Jun 25 '24 20:06 ugol-1

Updating here. First off, thanks very much for the continued conversation here. I managed to implement the fix for anyone who wants to do this locally: in sim_vehicle.py, add the following at line 837:

    if opts.enable_fgview:
        cmd.append("--enable-fgview")

Then, at line 1346, which is within the parse options for simulation, add the following:

group_sim.add_option("--enable-fgview",
                     action='store_true',
                     default=False,
                     help="Enable FlightGear view")

This will allow you to add --enable-fgview in your sim_vehicle.py command line call, and with fg running, it will visualize your vehicle's simulation properly.

Thank you for your fix @justin-slattery ! I have added it in this commit: b1fb4f3

@tridge the option to enable FlightGear view has been added to sim_vehicle.py thanks to @justin-slattery . Please take another look.

Thank you all very much for your continued conversation and development efforts!

All the best,

Justin

justin-slattery avatar Jun 27 '24 15:06 justin-slattery

@ugol-1 sorry for the delay in getting to this!

I've rolled this change into my PR over here: https://github.com/ArduPilot/ardupilot/pull/27993 which also adds the option to autotest.py

Thanks for doing this!

peterbarker avatar Sep 03 '24 08:09 peterbarker

Closing this one now as I've merged the combined-fix PR.

Thanks for everybody's efforts here - esp. @ugol-1 for the patches :-)

peterbarker avatar Sep 05 '24 01:09 peterbarker