Servers by jDrones

How to make the TFMINI rangefinder talk I2C

(Doug Hank) #82

@ppoirier Worked, THANK YOU!!! Weather is windy and snowy so no outdoor testing today. As for indoor with GPS disabled, were you flying in Loiter or Stabilize in your video above?

(ppoirier) #83

@DHank01 Good === hit the “like” button :wink:

I fly loiter using optical flow

(Nicolas Grunbaum) #84

@ppoirier: Hello Patrick, i’m trying to test the TF mini poc but i’m running into a small issue. Where do you got the mavlink.h library for the teensy? I got one but the distance message is not there. So i ‘stole’ it from the cleanflight code.


(ppoirier) #85

Hello Nicolas,
I generated it using the python export script, as showed in this excellent blog: MAVLink Step by Step

(Doug Hank) #86

@ppoirier In testing our copter with a Pixhawk, PX4FLOW, TFMINI Lidar for altitude, with all GPS parameters turned off(Optical Flow Only), we can take off in Loiter mode and hover relatively well but after a few seconds it kicks out of LOITER mode and we get an EKF variance error and looking at the EKF gages, the horizontal position EKF is high and in the orange.
When taking off in Stabilize and trying to switch modes to POSHOLD or LOITER the flight mode change fails. Altitude seems to be fine? These issues go away when we turn the GPS back on.
Do you have any suggestions or guidance? Any log plots you would like to see?

PX4FLOW and TFMINI Lidar with PIXHAWK Doesn't Seem To Work With GPS Disabled
(ppoirier) #87

Hello , I answered on your topic

(Nicolas Grunbaum) #88

thanks patrick…
That is what i was looking for!

After trying a while i still cant compile the project. Getting all sort of errors:

TFMINI_I2C_MAVLINK:74: error: ‘MAV_TYPE_GCS’ was not declared in this scope

‘MAV_COMP_ID_PATHPLANNER’ was not declared in this scope

Any hint?
(i followed the step by step guide)

(ppoirier) #89

Seems you are missing somethink in your mavlink library
try substituingthe define by the associated numbers from this

(Nicolas Grunbaum) #90

The error line is longer than just the PATHPLANNER (too long to put it here without spamming).

I build the mavlink using the step by step guide in a virtualbox linux. (it was impossible run it on windows).

(ppoirier) #91

I will upload my mavlink library on gitter tonight :wink:

(Nicolas Grunbaum) #92

cool thanks patrick…i don’t know why mine does not work at all.

(ppoirier) #93

@nicodh It is too big for github, I did a share drive

I will leave it open until you copy == let me know

(Nicolas Grunbaum) #94

Thanks downloading right now

Nicolas Grunbaum

(Nicolas Grunbaum) #95

Thanks Patrick, it’s done, i downloaded it, and tested it, it works. :slight_smile:

Thanks for the help!

Nicolas Grunbaum

(rickyg32) #96

Putting this out to the community. I seem to be in need of assistance. I flashed my pro mini with no issues, its wired up and double checked. I configured the Arducopter per the instructions. But no joy.
At rest the copters altitude reports as .15 meters and if I roll the machine on its side so it measures a longer distance if measures .23 meters. If I run my hand in front of the sensor it changes numbers quickly but only in the range of .15 to .23. I am stumped.
One small change. If I give it more room to measure it gives me higher numbers, I saw it go to 40 at one point. ITs a small room so its hard to get an unobstructed range.

I did sit the machine on the bench with the lidar over the edge. Its 1 meter to the floor and it read .21. No settings for the lidar in mission planner have any effect on the numbers other then to stop it from working.
I thought this may be a symptom of it outputting in say mm over CM…but I am not sure what the results would be like its its wrong.
Any thoughts would be appreciated.

(rickyg32) #97

What should it be MM or CM

(ppoirier) #98

Yes it look like the TFMINI is sending in cm,
here are the commands to:
Modify output unit to mm output: 42 57 02 00 00 00 00 1A
Modify output unit to cm output: 42 57 02 00 00 00 01 1A

Uou migh try to reduce gain as well on line 32

(rickyg32) #99

Merci beaucoup Patrick
That was it spot on. It’s working great now.

(ppoirier) #100

Bienvenue Ricky, happy it works

Hit the like button , that’s how I get paid here :slight_smile:

(rickyg32) #101

The button…???
Point me to the button I would be glad to hit it…lol