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

[Bug]: Camera_pointcloud example doesn't give accurate point cloud data or visualization #207

Open
Sapienscoding opened this issue Jun 25, 2024 · 0 comments
Assignees
Labels
bug Something isn't working

Comments

@Sapienscoding
Copy link

Sapienscoding commented Jun 25, 2024

Describe the bug

I was trying to execute camera pointcloud example under the farm-ng-amiga repository. There is no functionality to visualize the point cloud files, so I created a new python script to visualize it using Open3D. However, the visualizations doesn't come out to be correct, from the saved .ply files. This is the visualization python file that I used, after running the main.py file:

visualize.py

import open3d as o3d

def visualize_point_cloud(file_path):
    # Load the point cloud from file
    point_cloud = o3d.io.read_point_cloud(file_path)

    # Create a visualization window
    vis = o3d.visualization.Visualizer()
    vis.create_window()

    # Add the point cloud to the visualization
    vis.add_geometry(point_cloud)

    # Set the camera view point
    # vis.get_view_control().set_front([0, 0, -1])
    # vis.get_view_control().set_lookat([0, 0, 0])
    # vis.get_view_control().set_up([0, -1, 0])
    # vis.get_view_control().set_zoom(0.5)

    # Run the visualization
    vis.run()
    vis.destroy_window()

visualize_point_cloud("/home/shdh/farmng/farmng_code/farm-ng-amiga/py/examples/camera_pointcloud/pointcloud_166305.ply")

Results of disparity and pointcloud:

aruco_pointcloud
aruco_disparity

Relevant Versions

  • farm-ng-amiga: 2.3.0
  • farm-ng-core: 2.3.0
  • farm-ng-package: 0.1.3

Reproduction steps

  1. Save the above python script under the camera_pointcloud folder inside /farm-ng-amiga/py/examples.
  2. Under farm-ng-amiga repository navigate to cd py/examples/camera_pointcloud
  3. Execute main.py, python3 main.py --service-config service_config.json --save-pointcloud --save-disparity
  4. Once the pointcloud files and disparity images are saved.
  5. Enter the pointcloud file name, at this line in visualize.py (visualize_point_cloud("/home/shdh/farmng/farmng_code/farm-ng-amiga/py/examples/camera_pointcloud/pointcloud_166305.ply")
  6. Execute visualize.py, python3 visualize.py

Expected behavior

An Open3D window will open with some pointcloud, technically it should match the shape of an object, but it will give something random.

Additional context

No response

@Sapienscoding Sapienscoding added the bug Something isn't working label Jun 25, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants