Skip to content
This repository has been archived by the owner on Aug 1, 2024. It is now read-only.

Change input pointcloud FOV #689

Open
Cristian-wp opened this issue Nov 10, 2022 · 7 comments
Open

Change input pointcloud FOV #689

Cristian-wp opened this issue Nov 10, 2022 · 7 comments

Comments

@Cristian-wp
Copy link

Hello, I would like to use a 3D lidar instead of a depth camera. I had try with a Velodyne VLP-16, but in order to make it work I had to crop my Pointcloud at ~180° .
Is already possible to use a full 3D lidar pointcloud or this is not possible with the actual code?
In case where is the piece of code that I have to modify?

@CWC107753035
Copy link

CWC107753035 commented Dec 5, 2022

@Cristian-wp I'm not pretty sure, but I think you can try to modify the updateFOVFromMaxima in common.cpp and set the h_fov_deg by your own. And you should also modify FOV relative func like isOnEdgeOfFOV and scaleToFOV etc...... to make sure the path is ALWAYS in the FOV, since you are using lidar.

@Cristian-wp
Copy link
Author

Hi @CWC107753035 thank you for your feedback.
I had done a little software analisys on local_planner and my conclusion in similar. I have also find reference in PX4-Avoidance/avoidance/src/common.cpp , but I was thinking to modify only these two:
1)

bool pointInsideFOV(const std::vector<FOV>& fov_vec, const PolarPoint& p_pol) {
  for (auto fov : fov_vec) {
    if (pointInsideFOV(fov, p_pol)) {
      return true;
    }
  }
  return false;
}
bool pointInsideFOV(const FOV& fov, const PolarPoint& p_pol) {
  return p_pol.z <= wrapAngleToPlusMinus180(fov.yaw_deg + fov.h_fov_deg / 2.f) &&
         p_pol.z >= wrapAngleToPlusMinus180(fov.yaw_deg - fov.h_fov_deg / 2.f) &&
         p_pol.e <= fov.pitch_deg + fov.v_fov_deg / 2.f && p_pol.e >= fov.pitch_deg - fov.v_fov_deg / 2.f;
}

When I perform the modification I will let you know the results.
Have you already done something similar in the code?

@CWC107753035
Copy link

@Cristian-wp I only tried to change the FOV horizontal degree from calculation result to certain value, as I find out our real drone's FOV is unreasonably big and caused some problem. I only tested on the simulator(rviz) for now and it works fine.

@Cristian-wp
Copy link
Author

@CWC107753035 Can I ask you you new FOV value?

@CWC107753035
Copy link

CWC107753035 commented Dec 5, 2022

@Cristian-wp I only have a front camera so I just simply modify
fov.v_fov_deg = 50; fov.h_fov_deg = 50; fov.pitch_deg = 0; fov.yaw_deg = 0;

@Cristian-wp
Copy link
Author

Thank you :) I will let you know my results.

@raghavasrujan
Copy link

raghavasrujan commented Mar 19, 2024

@Cristian-wp @CWC107753035 Could you tell me what are the steps and files to change for the integration of the lidar?

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

No branches or pull requests

3 participants