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
irlock doesn't work with the irlock Pixy camera #10210
Comments
The same problem for Pixhawk 4 (Holybro) and IR-Lock (Pixy) sensor. Pixhawk does not communicate with Pixy via I2C. My steps:
The power source was checked, Pixy voltage is 5.0V checked. |
@roboflot |
@ndepal |
I actually was able to get this to work with ArduPilot on the Pixhawk 2.1. I used I2C bus 0 as my bus setting. We are moving to ArduPilot for future projects that require precision landing. I don't like the fact that ArduPilot has inferior debugging tools compared to PX4 (which has a fantastic CLI that you can use for debugging and testing) but it does seem like ArduPilot has better driver support for sensors and other hardware. One other thing I noticed is that the I2C ports and how they map to port settings seem to be pretty ambiguous in the documentation for both flight stacks. However after reading through tons of forums I have found that people have had success with I2C in many cases by daisy chaining their I2C devices off the GPS I2C bus instead of the dedicated I2C bus, that is another thing you could try. At some point in the future I may be revisiting this issue. Ultimately I think that each flight stack needs to clearly document which settings need to be used to access each port. I may even put together some documentation for that. |
@jonathan84clark |
Would love your help with any required documentation for I2C.
Generally speaking I've been told that for end users I2C should be pretty much plug'n'play. You can either attach direct to an I2C port or via a splitter. However if there is something missing (and I'm sure there is), particularly for I2C peripheral developers/debuggers we should certainly add that. As a summary of what we have now:
|
I have the same issue with the PX4, running the newest firmware. I will try changing I2C ports, and report back if it makes any difference. |
The first try was lucky! I got IR-Lock (Pixy) working on Pixhawk 4 (fmu_v5) with GPS port i2c. And now I'm thinking on how to make a tricky wiring and share this port with original GPS module. |
Its too bad it has to work like that. I2C is supposed to be plug and play. It seems inconvenient to have to re-wire the GPS port to work as I2C. |
@bkueng This highlights possible problem with I2C driver. Essentially pixy IR-lock camera works on the GPS connector I2C port on Pixhawk2 but not on the "dedicated" I2C port. Is there some thing we can do to help these guys help us find root cause? |
Yes we can change the default port or scan all ports. @DanielePettenuzzo is the right one for that :) |
@jonathan84clark @roboflot With this PR you can start the driver with the -b argument on any bus: #10673. It is explained inside the pr. I will also implement the -a argument to scan all busses. Let me know if it works. |
I've just installed the latest master and I confirm IR-Lock successfully starts with "irlock start -b 4" on I2C A port. No tricky wiring needed! Holybro Pixhawk 4 FMU_v5. @ALL Thank you guys a lot for your help! |
Thanks @DanielePettenuzzo (and @roboflot for testing). @DanielePettenuzzo @bkueng This is cool, but even if you add the |
I can confirm the changes made it possible to start irlock on "I2C 2" with Thanks for fixing it! |
@hamishwillee I can add the -a option in the driver so that we can then use a param in the startup script. When the param is enabled we start the driver with the -a flag so all available busses are scanned. |
That is awesome. This should be default behaviour for every sensor and peripheral (ie user should be able to turn things on an off through UI). Only exception would be fmuv2, where they might have to uncomment the drivers. |
Has anyone been able to make IRlock work, while flying? |
Hmmm. I have been able to get it to work flawlessly with ArduPilot. One thing you should do is make sure you put the right firmware on the Pixy. https://irlock.readme.io/docs/firmwaresoftware-links |
Same here, I tried precision landing from mision and it does a normal landing. I installed on pixy the firmware provided by IR-Lock . Did you solved it? What I am doing wrong? |
From the log I can see irlock detects the beacon, but it abandons precision landing on it because it times out. I thought about disabling the Kalman filter but it is not an option in the px4 stack - as far I am aware. |
Hi, here is a log not doing a precision landing? Any idea why the errors? |
@ndepal Could you have a look? |
@VTOLDavid The reason why the precision lander is timing out during the horizontal approach phase is that it is not able to control the horizontal offset to < 0.2 m ( This may be due to poor position control performance. Things you can try:
|
Thank you! I will test it today. |
After some tuning It landed perfectly, even with the beacon moving. |
@VTOLDavid glad to hear that. What did you end up tuning? Perhaps it's worth adding your learnings to the precision land user guide. |
@VTOLDavid it would be awesome to see your tuning parameters. |
We flew with a little quad we use for tests. It was not properly tuned in position so that was the first thing we did. We limited angular speed to 100deg/s, we suspected that fast changing angle was not helping with beacon detection.
All others parameter related with precision landing were as default. We tested the precision landing sending this command from Qgrouncontrol command line: We have to test if using the mission command we get the same result. Theoretically it should be the same. Later, we decreased We moved the beacon once the landing descent had started from 20m and it followed the beacon and landed over it. Moving the beacon to fast made the drone to lose it and climbed to 20m again. I supposed that once at search altitude it would actively search, moving in spiral or following a circumference but it stayed in hover until the time We probably test a wider angle lens since it loosed the target quite easy. I would share a proper log but I forgot to remove the log config file from the sd card and loged landing_target_pose and vehicle_local_position. |
Hello, any chance some of the logs posted by @VTOLDavid are still available? I'm having the same issue. I'm trying to compare results before trying out his tuning values. |
PS: Using @VTOLDavid 's values, my drone lands precisely within a reasonable radius every time. What I did to get it working without having to build my own version of px4 to have the irlock driver and landing target estimator module running:
|
This issue has been mentioned on Discussion Forum for PX4, Pixhawk, QGroundControl, MAVSDK, MAVLink. There might be relevant details there: https://discuss.px4.io/t/px4-community-q-a-june-14-2023/32616/1 |
Using build for px4fmu-v3_default
When I scope the lines I am seeing no attempt being made by the Pixhawk 2 to communicate with the Pixy over I2C.
The Pixhawk 2 initiates communication with an ms4525 over the same I2C bus
I have changed the frequency (which apparently does nothing)
I have changed the bus (tried 0, 1, 2, 3)
I have changed the device path from "/dev/irlock0" to "irlock" no luck
I am testing this by attempting to initialize communication manually with the mavlink console by typing 'irlock start'
The response says "[irlock] failed to initialize device, stopping driver"
After some debuging code I found that it is failing at the probe stage. When it attempts to perform the transfer it responds with an error code -6.
This works perfectly well in ArduPilot.
I am not testing on a drone, just connecting the Pixhawk 2 to my computer (the drone is still being assembled)
Any help on this would be great.
Thanks,
Jonathan L Clark
Software Engineer
xCraft
The text was updated successfully, but these errors were encountered: