$15 360 degree XV proximity lidar

Hi Sir, I try to find a way to exchage messages directly with you. I think you can help me , maybe we can work together on my project ! You seem really good in it.

Please reach me info@zyx.blue

Thanks
Introduction :
I’m working on a project of prototype boat on foil. Please look at the video : LinkedIn ou Youtube

As you can see the boat is going up and down.

I’m trying to stabilized it using a sensor : AJ-SR04M ( link)

The sensor is connected to Orange Cube Arduino (link)

I would like to have a lua script working with mission planner that accelerate when it’s getting closer to the surface and decelerate when it’s too high above the water.

Sometimes there are some waves, so we need to work on an average value calculated during a time cycle (1 sec)

Today I can display on Mission planner the distance calculated by the rangefinder sensor. It’s working fine but I don’t know how to collect it and control the thruttle.

@Samathey I am not that good with lua, but I was asking about doing PID in lua for a boat stabilizer and was pointed to the aerobatics lua script as it uses PID, but I havent had a look at it yet.

Dear Francis,
Thanks a lot for your time and your expertise.
I have tried to read the code you sent me.
I got the feeling that for the distance they use the gps data (Vector3f) and not Rangefinder value.
I need help for sure to be abble to get the distance above the water value and to be abble to control thruttle. If you have some time Im ready to offer you good wine or a dinner…


.

I used

local depth_under_boat = rangefinder:distance_cm_orient(25) when I made my shallow water avoid script to look at the downwards facing rangefinder

please start a new post if you want help.

I had it out for a test outside and it works far better than i expected, it can detect the brick walls over 5 meters away

That’s awesome! I think i will try to buy one of these lidars and try it myself, because i think the VL53L1X lidars i bought earlier are most likely not working correctly :confused: .just wondering where to put all the antennas so they won’t intercept the laser signal…

2 Likes

I just increased the minimum distance in the PRX1 parameters so it ignores anything on the vehicle. On my rover it was detecting the camera mast until I changed it.

Clever! Will order it and try.

1 Like

Hi francis, I wanted to say thanks to you.
I tried taken example of your code and yes using “rangefinder:distance_cm_orient(25)”
gave me the distance ! I’m so glad.
Please what means the param “(25)” and more likely where can i discover all the definition of this kind of functions. I will try to start a new post. Regards Sam
Sam_1.lua (284 Bytes)

1 Like

When you attach a rangefinder to ardupilot you assign it an orientation, it has 8 faces around it numbered 0-7 and the downwards facing sensor is assigned orientation 25.

SwNoob Issues:
Tried to build the sketch for the rp2040zero, using a clean install ArduinoIDE 2.2.1, and Raspberry Pi Pico/2040 by E.F.Philhower 3.4.1.
But the first got stuck on the mavlink library… ‘could not find mavlink.h’, but the install of the rest of the lib’s were ok… ended up unziping it in the .ino folder for the XV_Lidar app and got past that.
But then got stuck on analogWriteFrequency not declared in this scope in the xv11lidar.cpp, and hacking past that one i got trouble with the UART Serial2 call in the XV_Lidar app…

So i guess that i have f…d up some where on the way…

Are you using the pico/RP2040 board manager or the Mbed OS RP2040? (Saw some references about that regarding the uart issue )

This uses the official board library from arduino the Mbed OS RP2040 board package. you shouldnt have to change anything.

Will any other xiaomi lidar work? I mean they are designed for different vacuum cleaners, but are their pinout different? Or will they work just fine? Just looking for something in my country with faster delivery.

im not sure, the only other one I know will work is the neato XV, you could look for other lidars that use the same chips but im not sure how far you will get.

https://www.aliexpress.com/item/1005003029046449.html

Does the “XV” stand for the chip they are using? Thought about using other lidars from xiaomi that are pretty similar to the one you mentioned, but not sure if they will work, for example this one:

https://pl.aliexpress.com/item/32995890839.html?spm=a2g0n.productlist.0.0.1e1d70e5pVaQHa&browser_id=5128a8b6a3f84e04b54b705793bbd67a&aff_trace_key=8c3bd0d0d4784fe0a74ef520bb13eace-1694531589872-03567-UneMJZVf&aff_platform=msite&m_page_id=hghhcerdxycavxgo18a89f44ecf2334fd53caacc9e&gclid=&pdp_npi=4%40dis!PLN!119.39!95.04!!!26.96!!%4021038ede16945316041633160e09f2!10000000169641459!sea!PL!0!AS&algo_pvid=e92afaf6-2e48-4f0c-9e2a-2f4df4e45a52&search_p4p_id=202309120813241959680413395510000504869_1

(Excuse the long link)

The neato XV vacuum cleaner is the first version of the lidar that most of the software is wrote for but are getting expensive and hard to find. The xiaomi lidar is just the cheapest version I could find that was compatible going off of what I could find online.

There is the delta 2a, It needs totally different software but the one I ordered arrived faulty, so I have not had a chance to get one working.

I have no idea if other versions are compatible, unless you can find documentation online of its protocol there is no way of knowing other than testing.

What protocol should i look for?

it’s not a published protocol, I just spent a lot of time on google looking for any documentation on using vacuum lidars with Arduino and I found mention that this was compatible with the XV lidar code ibraries.

hmm… trying and trying… cleaned the install… reinstalled Arduino IDE environment again… installed “Arduino Mbed OS RP2040 Boards” v4.0.6, but still get “xv11lidar.cpp:34:3: error: ‘analogWriteFrequency’ was not declared in this scope
analogWriteFrequency(m_pwm_pin, 100);” From what i can tell the mbed librarys has a function ‘analogWriteFreq’ but not the requested function. I guess that indicates I stil have failed at something.

Where is analogWriteFrequency declared? (In what lib?)

have you installed the PID library