ardupilot_wiki icon indicating copy to clipboard operation
ardupilot_wiki copied to clipboard

WIP Add ARK Flow

Open AlexKlimaj opened this issue 3 years ago • 16 comments

AlexKlimaj avatar Jun 23 '22 20:06 AlexKlimaj

I think one of our devs is verifying compatibility with AP...waiting for feedback from him....do you intend to add AP compatibility to your product description on your web page, once its verified? thanks

Hwurzburg avatar Jun 24 '22 12:06 Hwurzburg

Henry, there are a number of folks on the Discord that have said it is working. I also believe @patrickpoirier51 was going to be testing the updates Alex made recently to add gyro compensation outputs as well.

hendjoshsr71 avatar Jun 24 '22 18:06 hendjoshsr71

A few people have reported that it is working with Ardupilot. I am trying to test it myself, but I am struggling through setting up Ardupilot with cannodes. I'm not really sure how I can verify everything is working before flying. In PX4, I can use the shell to check enumerated nodes. It does not appear that Ardupilot is booting my GPS and Flow cannodes.

AlexKlimaj avatar Jun 24 '22 22:06 AlexKlimaj

Alex if you cant get it to work we can see about a screenshare on Discord?

You can use the DroneCAN GUI tool to see most of the info. of nodes update params and update firmware.

hendjoshsr71 avatar Jun 25 '22 05:06 hendjoshsr71

Affirmative, I am waiting for a unit thanks to @AlexKlimaj @peterbarker has one on hand, maybe he could confirm if all OK

patrickpoirier51 avatar Jun 25 '22 11:06 patrickpoirier51

Just received it , and did basic config and bench test The setup is similar to HereFlow Set FLOW_TYPE = 6 (DroneCAN) Set CAN_P1_DRIVER = 1 to enable DroneCAN Set CAN_D1_PROTOCOL = 1 (DroneCAN)

To use the onboard lidar: Set RNGFND1_TYPE = 24 (DroneCAN) Set RNGFND1_MAX_CM = 3000 to set range finder’s maximum range to 30m

Sensor status can read correctly when looking up and moving hand over sensors image

Reading on Mission Planner SLCAN work OK image

@AlexKlimaj How do we change Can Node Address ?

Next step Calibration & Flight test

patrickpoirier51 avatar Jul 01 '22 10:07 patrickpoirier51

I did the calibration

image

but unfortunately I experience an issue with the OF Fusion ( the bad lidar is the Cygbot device that is not powered) image

I tried loading this binary = 80-0.1.ffb00970.uavcan.bin but still same issue. @AlexKlimaj are you using the modified KLT version for ArduPilot ? https://github.com/priseborough/px4flow/tree/klt_flow

I can upload log if anyone interested

patrickpoirier51 avatar Jul 01 '22 13:07 patrickpoirier51

@patrickpoirier51 to change the node ID, you need to adjust the CANNODE_NODE_ID parameter on the ARK Flow.

I am not using the modified KTL version. The ARK Flow runs PX4.

Here is the board config. https://github.com/PX4/PX4-Autopilot/tree/main/boards/ark/can-flow

Here is the optical flow sensor driver. This publishes the raw optical flow readings. https://github.com/PX4/PX4-Autopilot/tree/main/src/drivers/optical_flow/paw3902

The vehicle optical flow module in sensors consumes the raw optical flow data and syncs it with the gyro reading. That gets published to vehicle_optical_flow. https://github.com/PX4/PX4-Autopilot/tree/main/src/modules/sensors/vehicle_optical_flow

Finally, the uavcannode publishes vehicle_optical_flow to the dronecan flow_measurement message. https://github.com/PX4/PX4-Autopilot/blob/main/src/drivers/uavcannode/Publishers/FlowMeasurement.hpp

AlexKlimaj avatar Jul 01 '22 17:07 AlexKlimaj

to change the node ID, you need to adjust the CANNODE_NODE_ID parameter on the ARK Flow. If you look above on the Reading on Mission Planner SLCAN there is no CANNODE_NODE_ID parameter As you can see there is only: CANNODE_GPS_RTCM,0 CANNODE_TERM,0

I doublecheck with the DroneCAN GUI , no change.

As for the flow reading, it is fused within EKF as a KLT type decode so I wonder how @mcelhennyi is using it

patrickpoirier51 avatar Jul 01 '22 18:07 patrickpoirier51

to change the node ID, you need to adjust the CANNODE_NODE_ID parameter on the ARK Flow. If you look above on the Reading on Mission Planner SLCAN there is no CANNODE_NODE_ID parameter As you can see there is only: CANNODE_GPS_RTCM,0 CANNODE_TERM,0

I doublecheck with the DroneCAN GUI , no change.

As for the flow reading, it is fused within EKF as a KLT type decode so I wonder how @mcelhennyi is using it

We configured it as you did I believe, and after flashing the new firmware (80-0.1.db238486 - which is not the master version I think, just before that) it just worked.... Let me get my hardware guy to verify our configs are similar.

Are you only having issues with the lidar? We had that working even before the flow upgrades I think.

mcelhennyi avatar Jul 01 '22 19:07 mcelhennyi

That<s OK , I found the issue, I was not using the Compass in the EKF (because of another config...) , thanks, so far so good Next I will test outdoor at some altitude

patrickpoirier51 avatar Jul 01 '22 19:07 patrickpoirier51

Here are the result of the outdoor test over a long grass and medium wind (10-20 km/h)

First the rangefinder distance measurement (configured to 30M) , I would say that the practical limit outdoor is 20M: image

Then the OF measurement, this is a window showing that EKF reject measurement when less than 140/255 that roughly correspond to 10meter in this test situation image

patrickpoirier51 avatar Jul 02 '22 12:07 patrickpoirier51

I think one of our devs is verifying compatibility with AP...waiting for feedback from him....do you intend to add AP compatibility to your product description on your web page, once its verified? thanks

@Hwurzburg I have completed test == OK

patrickpoirier51 avatar Jul 02 '22 12:07 patrickpoirier51

@AlexKlimaj cant merge this...there is no common page common-arkflow.rst describing the device and its setup

Hwurzburg avatar Jul 02 '22 18:07 Hwurzburg

A page similar to https://ardupilot.org/plane/docs/common-hereflow.html. It's very similar except for a different distance on the range finder. Also it's px4 parameters on the node, but that's going to be normal as more nodes come to market. I'll do that in conjunction with the Ark CANnode. Just have to wait for my cube orange to make it back to my desk after testing.

TunaLobster avatar Jul 03 '22 17:07 TunaLobster

A page similar to https://ardupilot.org/plane/docs/common-hereflow.html. It's very similar except for a different distance on the range finder. Also it's px4 parameters on the node, but that's going to be normal as more nodes come to market. I'll do that in conjunction with the Ark CANnode. Just have to wait for my cube orange to make it back to my desk after testing.

Thanks, I have added an ARK Flow page.

AlexKlimaj avatar Aug 01 '22 22:08 AlexKlimaj

@patrickpoirier51 @AlexKlimaj is this ready for merge? several open unresolved comments

Hwurzburg avatar Oct 23 '22 12:10 Hwurzburg

@AlexKlimaj any progress on the WIKI ?

patrickpoirier51 avatar Oct 23 '22 12:10 patrickpoirier51

Note, I'm not good at checking this notifications screen. I should be better - but if you really want a response, direct email is better.

hamishwillee avatar Oct 25 '22 05:10 hamishwillee

@AlexKlimaj I thought I'd push this support along a bit by updating the firmware and verifying receipt of the gyro data on the device (which I believe is a feature in the updated firmware).

I've tried two firmwares, the oldest I could find (https://github.com/PX4/PX4-Autopilot/releases/tag/v1.12.0-beta5) and the newest firmware I could find (https://github.com/PX4/PX4-Autopilot/releases/tag/v1.13.1).

Bootloader seems to work just fine when uploading ark_can-flow_default.px4, but the device briefly enters a "critical" state and then stays in the INITIALIZATION state. It's node 125 in the following: image

It *was running a version represented as 1.7/ffff in the Software Version/CRC64 field - and it was working fine there apart from the missing data.

Suggestions?

peterbarker avatar Dec 01 '22 04:12 peterbarker

@peterbarker Thanks for following up on this. The .px4 files are not the correct firmware files for flashing the px4 cannodes. You need to use the 80-0.1.xxxxxxxx.uavcan.bin where xxxxxx is the git hash. See attached binary.

80-0.1.c5dc1221.uavcan.bin.zip

AlexKlimaj avatar Dec 07 '22 18:12 AlexKlimaj

@peterbarker Thanks for following up on this. The .px4 files are not the correct firmware files for flashing the px4 cannodes. You need to use the 80-0.1.xxxxxxxx.uavcan.bin where xxxxxx is the git hash. See attached binary.

80-0.1.c5dc1221.uavcan.bin.zip

Ah! Much better, thanks!

Not only do I have a node that's not stuck in INITIALISING, but I'm now getting rate_gyro_integral field values, which is what it was missing.

I'm sure this isn't the only device out there that would benefit from this improved firmware - do you have a perma-link to it? We can potentially put it up on firmware.ardupilot.orgif you don't have a download site for it. In any case, a link in this PR to the firmware would be a good idea IMO.

peterbarker avatar Dec 09 '22 03:12 peterbarker

@peterbarker Great! I just posted the ARK Flow binary in the PX4 1.13.2 release.

https://github.com/PX4/PX4-Autopilot/releases/tag/v1.13.2

https://github.com/PX4/PX4-Autopilot/releases/download/v1.13.2/ark_can-flow_default.zip

AlexKlimaj avatar Dec 09 '22 18:12 AlexKlimaj

@AlexKlimaj Alex where do we stand on this....seems a few unresolved comments....but would like to merge if you are shipping these

Hwurzburg avatar Dec 31 '22 17:12 Hwurzburg

@AlexKlimaj Alex where do we stand on this....seems a few unresolved comments....but would like to merge if you are shipping these

@Hwurzburg I took care of the last comment and rebased into a single commit.

AlexKlimaj avatar Jan 02 '23 22:01 AlexKlimaj

thanks...merging

Hwurzburg avatar Jan 03 '23 00:01 Hwurzburg