linorobot / linorobot2

Autonomous mobile robots (2WD, 4WD, Mecanum Drive)
Apache License 2.0
469 stars 160 forks source link

Realsense Pointcloud2 and Voxellayer issue #30

Closed Sylvania2 closed 2 years ago

Sylvania2 commented 2 years ago

Voxellayer never adds marked voxels, and robot hits everthing lower than the laser. Pointcloud is working and can be seen in RVIZ I tried changing raytrace_min_range: 0.5 to lower and higher value. But that didn't work

Found a suggestion that the sensor frame is wrong. Pointcloud topic: /camera/depth/color/points has "camera_depth_optical_frame" as frame_id. And that should be defined. Not tested yet.

realsense: topic: /camera/depth/color/points raytrace_min_range: 0.5 min_obstacle_height: 0.0 max_obstacle_height: 2.0 clearing: True marking: True sensor_frame: camera_depth_optical_frame data_type: "PointCloud2"

Or that the depth_sensor.urdf.xacro should match the Pointcloud frame_id:

Anyone using RpLidar and Realsense Pointcloud2 / Voxellayer ? And how did you make this work ?

Best regards Kim

grassjelly commented 2 years ago

hey @Sylvania2 . Thanks for reporting this issue. It was actually working just that it's only available on the global costmap. Added the same parameter on local costmap. You can check out the changes here: https://github.com/linorobot/linorobot2/commit/08401ddb5d590ae1699edec3788ecf708c14b4b4

Sylvania2 commented 2 years ago

hey @grassjelly . Found almost same solution this morning. Copied voxel3d_layer code segment to local costmap, and now the cookie box in front of the robot is marked, not testet live. I will try you code tonight 👍

Best regards Kim

Sylvania2 commented 2 years ago

Fix is working. Thanks. Closing