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

adding new peripheral class as a container for simulator and activating simulated buzzer code #92

Conversation

catch-twenty-two
Copy link

This revisits and finishes up the ability to receive a tone alarm over mavlink from the px4 simulator. There is a corresponding px4 pr that implements sending the message here:

PX4/PX4-Autopilot#11431

In addition this pr also adds a new peripheral class which can be modified to add leds, gimbals, other buzzers and any other simulated peripheral that would be a benefit.

Original concept/prototype demonstration is here (this pr adds same functionality):

https://www.youtube.com/watch?v=t7cvCfbbXbE

julianoes and others added 5 commits February 20, 2019 11:40
This adds a CLI argument to enable lockstep. This should restore HITL in
its original working shape.

The problem was mainly that we used the simulator time instead of the
computer time and also we ran update twice which is required for
lockstep. One step is to receive messages from the autopilot, and the
other step is to send new messages out.

This change will require that we use the cli flag on the PX4 side.
@catch-twenty-two catch-twenty-two force-pushed the pr-activate-buzzer-as-peripheral branch from 224b823 to d3d1c93 Compare February 20, 2019 19:41
@mcsauder
Copy link

mcsauder commented Aug 1, 2019

@catch-twenty-two , would you resolve the conflicts in this PR so that I can test it? Thanks!

@mcsauder
Copy link

mcsauder commented Aug 7, 2019

@catch-twenty-two , I've applied your changes in this PR to the current jMAVSim master branch and I get exceptions thrown from the modified code:

Exception in Simulator.world.update() : 
java.lang.NullPointerException
	at me.drton.jmavsim.MAVLinkHILSystem.handleMessage(MAVLinkHILSystem.java:145)
	at me.drton.jmavsim.MAVLinkConnection.sendMessage(MAVLinkConnection.java:36)
	at me.drton.jmavsim.MAVLinkNode.sendMessage(MAVLinkNode.java:29)
	at me.drton.jmavsim.UDPMavLinkPort.update(UDPMavLinkPort.java:147)
	at me.drton.jmavsim.MAVLinkConnection.update(MAVLinkConnection.java:44)
	at me.drton.jmavsim.World.update(World.java:33)
	at me.drton.jmavsim.Simulator.run(Simulator.java:510)
	at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511)
	at java.util.concurrent.FutureTask.runAndReset(FutureTask.java:308)
	at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.access$301(ScheduledThreadPoolExecutor.java:180)
	at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(ScheduledThreadPoolExecutor.java:294)
	at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)
	at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)
	at java.lang.Thread.run(Thread.java:748)

Line 145 where the exception occurs is where filterMessage() is being called: vehicle.getPeripherials().getBuzzer().filterMessage(msg);

Could you deconflict/rebase this PR so that I try to validate your work? Thanks!

-Mark

@mcsauder
Copy link

@catch-twenty-two , should we try to resolve the conflicts in this PR or close it out?

@catch-twenty-two
Copy link
Author

@mcsauder closing this for now, maybe Ill revisit it some other time

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

Successfully merging this pull request may close these issues.

3 participants