Skip to content
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

added sf45 as a seperate rangefinder #3448

Open
wants to merge 8 commits into
base: main
Choose a base branch
from
Open

added sf45 as a seperate rangefinder #3448

wants to merge 8 commits into from

Conversation

Claudio-Chies
Copy link
Contributor

@Claudio-Chies Claudio-Chies commented Nov 11, 2024

  • Adapted and updated the documentation for the SF45 Rangefinder
  • Added it to sensors instead of a chapter in collision prevention, although thats the main usecase.
  • marked the Lanbao Sensor as EOL, as i cant find it available anymore, and some sellers marked it as EOL

Relevant PR's

@hamishwillee
Copy link
Collaborator

This is IMO ready when your PR is ready - thanks very much!!! I did some restructure to make the new rangefinder doc a sub-doc - that allows us to expand the structure if we want in future.

Note that the build error can be ignored. It happens because I moved one of the image files alongside the other, and the existing translations depend on that location. This will be fixed after merging by crowdin.

Comment on lines 70 to 76
## Debugging / Common problems
If you are experiencing start-up issues, jerky movements or a lot of com errors displayed with `lightware_sf45_serial status` this could mean that you are having power issues.

The Sensor seems to be quite sensitive in regard to whether he gets enough power.
According to the Datasheet, the sensor needs 300 mA of current at 5V, whereby the stock cable is fairly long and can cause problems where the voltage drops too much.
So it's important to make sure that the cable is kept as short as possible.
As an alternative, you can power the SF45 via a separate Step-down converter from battery voltage. With this approach, you're able to eliminate all power-related issues.
Copy link
Collaborator

@hamishwillee hamishwillee Dec 4, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
## Debugging / Common problems
If you are experiencing start-up issues, jerky movements or a lot of com errors displayed with `lightware_sf45_serial status` this could mean that you are having power issues.
The Sensor seems to be quite sensitive in regard to whether he gets enough power.
According to the Datasheet, the sensor needs 300 mA of current at 5V, whereby the stock cable is fairly long and can cause problems where the voltage drops too much.
So it's important to make sure that the cable is kept as short as possible.
As an alternative, you can power the SF45 via a separate Step-down converter from battery voltage. With this approach, you're able to eliminate all power-related issues.
## Debugging / Common problems
Start-up issues, jerky movements, or a lot of coms errors displayed with `lightware_sf45_serial status` could mean that the sensor is not getting enough power.
According to its datasheet, the sensor needs 300 mA of current at 5V.
The supplied cable is fairly long and when connected to a 5V supply, the voltage at the rangefinder may have dropped below the required level.
One mitigation/alternative is to power the SF45 via a separate step-down converter from battery voltage, ensuring that there are 5V across the rangefinder itself.

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@Claudio-Chies Where you say

The stock cable is fairly long and can cause problems where the voltage drops too much, so it is important to keep the cable is kept as short as possible.

Do you mean this is supplied with a cable but it is too long? Are you then proposing that the user gets a different cable that is shorter, or cuts this one back?

Depending on your answer I'll modify the suggestion above.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, the stock cable is 35cm, when using that cable, then supplying power from an BEC is recommended.

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

OK, I have modified the #3448 (comment) and will merge. Please check it is right now.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

i've added a commit where i specify that we are talking about the 5V supply from TELEM ports, and not any 5V supply

@hamishwillee
Copy link
Collaborator

I've separately added a PR the lanbao, so that this isn't mixed in with this PR about #3487

Copy link

No flaws found


<video src="../../assets/hardware/sensors/lidar_lightware/sf45_plotjuggler.mp4" width="720" controls></video>

In order to generate this kind of plot you will need to add the following Reactive Scripts to PlotJuggler.
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What is a Reactive Script? Is there a good link to a definition we can add here for someone wanting to learn more?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Reactive scripts are Lua scripts inside plot juggler, sadly the documentation for PlotJuggler is severely lacking. So there's no good source on what it actually is.

In order to generate this kind of plot you will need to add the following Reactive Scripts to PlotJuggler.
If you save these scripts and then add new data, you will see a new timeseries called `obstacle_distance_xy`, which is the same as is displayed in the video.

**Global code, executed once:**
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is it bleedingly obvious how you execute/add these scripts? If not then we need to either add a link to instructions or explain how here. Up to you which.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sadly not, i'll add a screenshot, and mention where the setting is.


Debugging problems with distance sensors is much easier if you can plot the [OBSTACLE_DISTANCE](https://mavlink.io/en/messages/common.html#OBSTACLE_DISTANCE) message in an x-y plot, because this lets you directly see the orientation of the measurement in respect of the drone.

The video below shows how you can view such a plot in PlotJuggler.
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I assume this is a live view as per https://docs.px4.io/main/en/debug/plotting_realtime_uorb_data.html ?

Can we link to this too?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

no, currently its just a log replay. i found a way you can adapt the script to use for realtime debugging with it, i can write the code for it in collision prevention in a seperate PR

@hamishwillee
Copy link
Collaborator

Can we get the video on PX4 youtube and link it. The file is not huge, but obviously it is cheaper if authors don't have to download it for local editing

@Claudio-Chies
Copy link
Contributor Author

a video of the SF45. the plotjuggler layout or of the drone flying?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants