How to enable rangefinder in SITL Simulator

If it’s possible, I’d like to simulate using my LW20/C in the Mission Planner SITL Simulator.

The docs direct parameters for an analog rangefinder as follows:

These docs are for using the MavProxy simulator - but perhaps the settings are the same.

Following this guidance, the simulator reports that the rangefinder is not detected.

I noticed in the Adding an Optical Flow Sensor section (right below Adding a Rangefinder) there’s reference to setting a parameter that enables the optical flow sensor.

Is it possible that there is something like that required to enable a rangefinder?

If a Lightware LW20/C (I2C connection) isn’t supported, the analog rangefinder will likely suffice for my purposes using the simulator.

Thank you!

I never did it but you can connect serial devices to sitl

Thanks Mustafa - I appreciate the suggestion. I’m not sure I can translate that reference from MavProxy to Mission Planner SITL. If you like, I’ll let you know if I figure it out.

MAVProxy can be installed to Windows, too.
But I don’t think you had to had that since you need to run sitl “exe” with some arguments to use USB as serial device.
Anyways, probably Windows will make you hit some walls on the port part.
I really recommend you to work on Linux.
You need to use the serial connection of the rangefinder and a UART adapter to connect to the PC.
Good luck…

Most of my LINUX work has been limited to creating LAMP stacks for Wordpress - running on a DigitalOcean droplet.

I do have a Raspberry Pi-4 that I could boot up.

I guess there’s AUX on my MACs - I’ve set up LAMP stacks on that too.

I can do the I.T. stuff - but my goal is to fly sUAS - I don’t want to do any more I.T. stuff than absolutely necessary.

There’s this weird grey area where software engineering touches sUAS operation within the ArduPilot sphere. I get the impression that the folks who write ArduPilot code have the notion that people operating ArduPilot drones should be willing to get into the code too. I will if I have to - but it’s a major detractor of the time and energy I have to learn how to use ArduPilot in a productive way.

It’s a good things that fellows like you are willing to help bridge the gap - thank you - your efforts are appreciated!

1 Like

I actually met Linus Torvolds once - got him to autograph a distribution CD. This was 20 years ago. He signed it “LT”.

Ran into the same thing, but

param set RNGFND1_TYPE 100

100 is code of SITL rangefinder backend.

Did the trick. Can maybe anyone in charge of the SITL code tell if the Analog one is not functional anymore (although there is code for it…)? If so, wiki probably needs to be updated

legend! Cheers buddy! I was going crazy why it doesnt work on mine!