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

Enable FlightGear view in sim_vehicle.py (#26540) #26541

Closed

Conversation

ugol-1
Copy link
Contributor

@ugol-1 ugol-1 commented Mar 16, 2024

Fixes #26540

@@ -833,6 +833,7 @@ def start_vehicle(binary, opts, stuff, spawns=None):
cmd.append("--start-time=%d" % start_time_UTC)

cmd.append("--sim-address=%s" % cmd_opts.sim_address)
cmd.append("--enable-fgview")
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should we make this a command-line option to avoid unnecessary overhead in 99.99% of sim_vehicle.py invocations?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

yes, we should

@@ -833,6 +833,7 @@ def start_vehicle(binary, opts, stuff, spawns=None):
cmd.append("--start-time=%d" % start_time_UTC)

cmd.append("--sim-address=%s" % cmd_opts.sim_address)
cmd.append("--enable-fgview")
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

yes, we should

@tridge tridge added the WikiNeeded needs wiki update label Mar 18, 2024
@tridge
Copy link
Contributor

tridge commented Mar 18, 2024

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

@justin-slattery
Copy link

justin-slattery commented May 29, 2024

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.

@peterbarker
Copy link
Contributor

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

@ugol-1
Copy link
Contributor Author

ugol-1 commented Jun 6, 2024

@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.

@justin-slattery
Copy link

@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
Copy link

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!

@ugol-1
Copy link
Contributor Author

ugol-1 commented Jun 22, 2024

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.

@justin-slattery
Copy link

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.

@ugol-1 ugol-1 force-pushed the sim_vehicle_enable_fgview branch from 0be69a4 to 8596ddd Compare June 25, 2024 20:00
@ugol-1 ugol-1 force-pushed the sim_vehicle_enable_fgview branch 2 times, most recently from e40b680 to 8113348 Compare June 25, 2024 20:05
@ugol-1 ugol-1 force-pushed the sim_vehicle_enable_fgview branch from 8113348 to b1fb4f3 Compare June 25, 2024 20:06
@ugol-1
Copy link
Contributor Author

ugol-1 commented Jun 25, 2024

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.

@ugol-1 ugol-1 requested a review from tridge June 25, 2024 20:09
@andyp1per andyp1per requested a review from peterbarker June 26, 2024 07:06
@justin-slattery
Copy link

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

@peterbarker
Copy link
Contributor

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

I've rolled this change into my PR over here: #27993 which also adds the option to autotest.py

Thanks for doing this!

@peterbarker
Copy link
Contributor

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 peterbarker closed this Sep 5, 2024
@ugol-1 ugol-1 deleted the sim_vehicle_enable_fgview branch September 5, 2024 21:17
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
WikiNeeded needs wiki update
Projects
None yet
Development

Successfully merging this pull request may close these issues.

sim_vehicle.py not sending data to FlightGear
5 participants