SICKAG / sick_ldmrs_laser

A ROS driver for the SICK LD-MRS series of laser scanners.
BSD 3-Clause "New" or "Revised" License
24 stars 19 forks source link

Incorrect Object Velocity #25

Open fouad1995 opened 1 year ago

fouad1995 commented 1 year ago

Hello ,

I'm using Lidar and trying to get the absolute velocity of object ( vehicle in my case ) and I'm subscribing from /objects topic and extracting Vx , Vy and Vzand calculated the magnitude of Vx and Vy to get the absolute velocity of the vehicle v_abs = sqrt(vx^2+vy^2) and the velocity is incorrect.

Are there any configuration needed to solve this problem ?

Note : the lidar is 1.10 meter from the ground.

mintar commented 1 year ago

What values do you get (you can run rostopic echo -n1 <topic>) and what were you expecting?

Also, did you look at RViz and check that the tracking works correctly?

fouad1995 commented 1 year ago

What values do you get (you can run rostopic echo -n1 <topic>) and what were you expecting?

Also, did you look at RViz and check that the tracking works correctly?

Yes you are right , RViz tracks the objects correctly and I can access the ID of the each objects and other information like bounding box ... etc. But when extracting the linear velocity components obj.velocity.twist.linear.x obj.velocity.twist.linear.y obj.velocity.twist.linear.z and trying to calculate the magnitude of the velocity with this equation magnitude = sqrt(vx^2 + vy^2) , it gives me incorrect speed.

How I checked that the speed is incorrect ?

Am I use a wrong formula to calculate the velocity or is there any other way to calculate the speed ?

jspricke commented 1 year ago

velocity is $v = {dx \over dt}$. What do you use as $dt$?

Never mind, you used the given velocity.

fouad1995 commented 1 year ago

~velocity is v=dxdt. What do you use as dt?~

Never mind, you used the given velocity.

Yes , I'm using the given velocity and just used the general formula of calculating magnitude of velocity

mintar commented 1 year ago

Small comment: I believe geometry_msgs/Twist gives the speed in m/s. If you expect 40 km/h, that should be about 11.11 m/s. Still a far way off from the 0.85 or 0.95 that you're getting.

That being said, our ROS node just forwards the values that we get from the scanner, so I'm afraid I can't help any further with that; it's best if you contact SICK directly about this. (We're not working for SICK, we just made this ROS driver for them).