prickle / Mavpixel

Mavpixel firmware repository
32 stars 12 forks source link

Mode Changes Not Updating NeoPixels #6

Closed mebj closed 6 years ago

mebj commented 6 years ago

I have just got everything installed and made some brief testing of these items:

Modes and Orientation Not working Arm State Working GPS Working

Warnings, Indicator, Throttle and RIng not yet tested.

As Arm state nd GPS works the communication between Mavpixel and FC must be running OK and these functions are also the most important ones for me.

It would be nice though to see the patterns indicating flight modes like Altitude, Position, Hold, Land and Return.

I have noticed that this issue has been covered before in another thread where missing types of airframe was the issue. My airframe in Qgroundcontrol is set to "Quadrotor" with subsetting of "DJI FlameWheel F450". FC is latest version of the Pixracer and firmware is PX4.

Thanks for a great system, I could not have programmed anything like it in a reasonable time myself

prickle commented 6 years ago

Hi @mebj. I see you are using PX4 firmware. I have not tested it - I would not expect it to work properly at all. It is surprising to me that Arm State and GPS are working.

I had not considered PX4 support. I will need to investigate further for a future release perhaps.

Thanks for your testing! Cheers, prickle

mebj commented 6 years ago

Sorry for not giving enough info. Your guess is right - leds do not change colors as expected. They are configured with directions, color and Modes and Orientation. A jpg of the GUI screen is attached and as shown Landing should turn selected leds orange but no change appears.

Hope this clarifies the issue somewhat, if not please have patience and ask again.

capture

prickle commented 6 years ago

Hi @mebj. Sorry, this will not happen soon.

PX4 has a different set of modes to Arducopter, despite some similar names. I would need to add a number of things to update the Modes & Orientation function for PX4.

First would be some way to determine it is in fact a PX4 that Mavpixel is talking to. Second would be a way to extract the proper PX4 mode number from the Mavlink stream. I think PX4 puts it somewhere different to Arducopter.

Third would be an additional section in CheckFlightMode() to correspond the PX4 native mode number to an appropriate Mavpixel known mode. Fourth would be to add any modes unique to PX4 to Mavpixel's known mode list. Beyond that is updating MavpixelGUI to also understand any new modes.

If one also considers the Warnings function and possibly others are also likely to need updating for PX4, one begins to realize this is no small undertaking. Unfortunately I don't have much spare time right now.

If you are keen and can program some I would encourage you to contribute as you are clearly well set up for testing. The code is a bit scrambled due to it's long history but not too complex and quick to figure out.

Or leave it with me and it will happen eventually :-)

Cheers, prickle

mebj commented 6 years ago

Hi @prickle. As alredy said the Modes function to me is just another "nice to have" while Arm and Gps are a real help. The best function anyhow is to be able to assign different colors to all the leds and this works. This can of course also be made by programming an Arduino but why do that when this elegant system is availabe and works well for that purpose and make changes an easy task.

I will take a look at the code but as I am new to Mavlink as well as PX4 I doubt I can do anything useful within a reasonable time frame.

Wouldn't it be nice if the bright programmers could agree on some kind of command standard at least for basic tasks like gps, arm, return, altitude hold, position hold etc. That would save a massive amount of programming hours and help open source a lot. And besides, why does everyone have to invent the wheel again.

Thanks again for making this program available to all and if you ever decide for an optional px4 addition I will be happy to help with the testing. I will also try to find info about some of your px4-specific questions in previous post.

Cheers. Mats

prickle commented 6 years ago

Hi @mebj. Thanks for your kind words. It is good to know something is working for somebody at least :-P You have introduced me to the idea of PX4 support though, a very valuable contribution in it's own right as it is not something I had considered and is certainly doable.

There are historical reasons, mostly boring and forgotten why the Mavlink system diverged between Arducopter and PX4. It now seems to me like they are coming back towards alignment as Arducopter improves it's Mavlink compatibility and PX4 strives to become easier to use.

At the end of the day they are moving targets and require readjusting aim from time to time. This is the nature of a fast-evolving ecosystem like our hobby drones. The jD-IOBoard firmware from which Mavpixel is forked is hopelessly out of date despite the fact it is only a few years older than Mavpixel itself.

I will find time to work on this project again in due course. Keep me updated with any progress!

Cheers, prickle