rosjava / android_core

Android libraries for rosjava
145 stars 166 forks source link

LaserScanLayer overlapping problem #251

Closed tony1213 closed 7 years ago

tony1213 commented 7 years ago

When I use Android phone to visualize the "/scan" data, it occured this problem

or

this

adamantivm commented 7 years ago

@tony1213 which Android application are you using to visualize "/scan" data?

tony1213 commented 7 years ago

This application is developing by myself ,using the Module”android_10“and the Module "android_15".In my Android Application, bulid.gradle(Module app) with this:

dependencies{ ... compile project(':android_15') ... }

develop platform: Hardware: Turtlebot2 , rplidar A2 Android Phone:Lenovo PHAB2 PRO IDE: Android Studio 2.2.2

adamantivm commented 7 years ago

OK, we're likely going to be doing some work in this area in the next few weeks. It is not immediate, but we will keep it in mind and update this issue if we find a solution or need more information.

tony1213 commented 7 years ago

Maybe I solve the problem by manipulate the LaserScanLayer.This is Modified part:

... // Calculate the coordinates of the laser range values. for (int i = 0; i < ranges.length; i += stride) { float range = ranges[i]; // Ignore ranges that are outside the defined range. We are not overly // concerned about the accuracy of the visualization and this is makes it // look a lot nicer. if (minimumRange < range && range < maximumRange) { // x, y, z vertexBackBuffer.put((float) (range Math.cos(angle))); vertexBackBuffer.put((float) (range Math.sin(angle))); vertexBackBuffer.put(0); } else { vertexBackBuffer.put(0); vertexBackBuffer.put(0); vertexBackBuffer.put(0); } angle += angleIncrement * stride; } ...

ernestmc commented 7 years ago

@tony1213 thanks for your report. The problem has been fixed with PR #252. Closing issue.