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

UAVCAN improvements #5271

Closed
wants to merge 14 commits into from
Closed

UAVCAN improvements #5271

wants to merge 14 commits into from

Conversation

pavel-kirienko
Copy link
Member

Greetings, my fellow humans.

This PR brings the following improvements:

  • Configuration parameter UAVCAN_ESC_IDLT, when set to 1, ensures that UAVCAN ESC will be running at a minimum throttle while the system is armed. The default value is 0, so it will not affect existing setups.
  • Beeping patterns during ESC enumeration were improved. One video is worth 1080 words: https://youtu.be/4nSa8tvpbgQ
  • Fixed HDOP/VDOP not being reported from CAN GPS. #5153 - HDOP and VDOP are populated with the value of PDOP.
  • A couple of minor cleanups in the code.

Mentioning @mhkabir and @aperture-laboratories because I want them to stay informed.

@mhkabir
Copy link
Member

mhkabir commented Aug 7, 2016

Standby for flight testing and video for user documentation.

@pavel-kirienko
Copy link
Member Author

Can someone please predict what release these changes will end up in? I'm writing some tutorials and I would like to pinpoint the minimum required version of PX4.

@mhkabir
Copy link
Member

mhkabir commented Aug 8, 2016

Changes were flight tested today on MAV5. Looking good! Everything works like it should, although I had to turn off a couple of drivers to reclaim some RAM. Otherwise the shell wouldn't work.

predict what release these changes will end up in.

@LorenzMeier 1.4.2, I'm sure?
@pavel-kirienko Can you please rebase this on master again?

@mhkabir
Copy link
Member

mhkabir commented Aug 8, 2016

3430966424237151550-account_id 1

@mhkabir
Copy link
Member

mhkabir commented Aug 8, 2016

Found 2 minor uavcan user experience related issues which should be fixed before release :

  1. UAVCAN node parameters do not appear correctly  mavlink/qgroundcontrol#3925
  2. With this PR, each uavcan node capable of beeping beeps during the node parameter sync, for example when connecting Qgroundcontrol.

@pavel-kirienko
Copy link
Member Author

Kabir, number 2 is not a bug, it's a feature. I added it in order to provide a simple audio indication that some UAVCAN related activity is happening. If you find it confusing we can easily remove it though (it's one line).

@mhkabir
Copy link
Member

mhkabir commented Aug 8, 2016

Hmm. It's kinda annoying. I don't know why we'd want that when connecting to a GCS. Also, what happens if we're in flight and we connect and the beep commands go through?

I also just found that saving UAVCAN params via QGC isn't working at all. The parameter write fails with a failure message from Firmware. Please check. This is critical for me since the Babel blew, and also in general for a smooth user experience.

@pavel-kirienko
Copy link
Member Author

what happens if we're in flight and we connect and the beep commands go through?

They will be ignored.

I also just found that saving UAVCAN params via QGC isn't working at all.

Thanks, I will try to repro this.

@proficnc
Copy link

proficnc commented Aug 8, 2016

I like the beeping as is... Found it quite reassuring that all systems were right.

@pavel-kirienko
Copy link
Member Author

I think I identified the problem with parameters. When responding to a parameter list request, the MAVLink-UAVCAN bridge converts the parameter data from uavcan_parameter_value_s to mavlink_param_value_t, losing the source node ID in the process. Looking at the inverse conversion in the parameter set request handler, I observe that the intention was to use the MAVLink Component ID to represent the value of UAVCAN Node ID (which makes sense), where the component ID is defined in the field target_component of the message type PARAM_SET.

The fundamental problem here, as I understand it, is that the message PARAM_VALUE doesn't have a field to indicate what MAVLink Component ID this value was obtained from. I'm not sure how this was even expected to work in the first place. Did we intend to substitute the source component ID when sending PARAM_VALUE with the UAVCAN node ID? If so, the MAVLink library does not seem to support this.

@bendyer

@pavel-kirienko
Copy link
Member Author

@proficnc I would like to keep beeping too, unless there are any UX issues with it I'm not aware about.

@pavel-kirienko
Copy link
Member Author

I propose to have this merged and resolve the parameter bridge issues separately. The branch has been merged with master.

@pavel-kirienko
Copy link
Member Author

I mean, the master has been merged into this branch, sorry about the confusion.

@LorenzMeier
Copy link
Member

the MAVLink libs support setting the origin component ID. It might need some tweaks on access but I can enable that certainly.

And yes, that's how it's supposed to work. We also should send a heartbeat for each subsystem with a different component ID.

@LorenzMeier
Copy link
Member

The CI systems still need to pass

@bendyer
Copy link
Contributor

bendyer commented Aug 8, 2016

@pavel-kirienko This was originally able to work because the UAVCAN node ID was passed in as the component ID parameter in _mavlink->send_msg: https://github.com/PX4/Firmware/pull/2981/files#diff-1a12062ccb751d0439a211a0cddce073R280

I believe your assessment of why it's not currently working is correct.

Looks like it might be possible to fix the issue without changing the mavlink_param_value_t definition by switching to some combination of mavlink_msg_param_value_encode_chan, mavlink_finalize_message_chan and _mavlink_resend_uart.

@pavel-kirienko
Copy link
Member Author

Build fixed by updating to a newer commit in master (it was broken there). I think I noticed that hysteresis and autodeclination tests are still sometimes failing randomly though.

@pavel-kirienko
Copy link
Member Author

CI reports are misleading and should be ignored - the master is still broken at the moment. This PR is ready for merging.

@pavel-kirienko
Copy link
Member Author

Nudge.

@mhkabir
Copy link
Member

mhkabir commented Aug 14, 2016

@LorenzMeier This is good to go. Flight tested a couple of times.

@pavel-kirienko How are we looking on the parameter bridge fix?

@pavel-kirienko
Copy link
Member Author

We need Lorenz to enable the origin component id setting in the MAVLink library. Rest is a piece of cake.

@NosDE
Copy link
Contributor

NosDE commented Aug 14, 2016

@LorenzMeier @pavel-kirienko flight looks good !
https://youtu.be/ZNsAkfqkHYQ

@mhkabir
Copy link
Member

mhkabir commented Aug 17, 2016

@LorenzMeier Can we get this in now?

It would also be great if you could quickly enable the required feature in mavlink to allow the parameter bridge to function correctly (#5277). I'm having some issues with aggressive control on the Orels, and need to tune the control parameters on the ESCs, which is impossible without the proper (or working, for that reason) parameter interface.

@LorenzMeier
Copy link
Member

Thanks everybody! Rebased and applied! Now on to fixing the MAVLink param issue..

@LorenzMeier LorenzMeier deleted the uavcan_esc_improvements branch August 18, 2016 15:15
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.

6 participants