omcandido / vrep_plugin_velodyne

V-REP plugin that publishes a full revolution of PointCloud2 point into ROS
https://www.robesafe.uah.es/index.php/en/smartelderlycar
6 stars 14 forks source link

make /velodyne_points topic locally #2

Closed gyubeomim closed 6 years ago

gyubeomim commented 6 years ago

https://github.com/omcandido/vrep_plugin_velodyne/blob/ddfe2454b1869e1035ae1c33c51bf7a8ee300ca9/src/velodyneROSModel.cpp#L173

we can put

m[3] = 0;
m[7] = 0;
m[11] = 0;
mainSensTrInv[3] = 0;
mainSensTrInv[7] = 0; 
mainSensTrInv[11] = 0;

code before this code to make it locally.

m[3] = 0;
m[7] = 0;
m[11] = 0;
mainSensTrInv[3] = 0;
mainSensTrInv[7] = 0; 
mainSensTrInv[11] = 0;                  
simTransformVector(m,p); //directly relative to /odom (which in simulation is actually /map)

got hint from http://www.coppeliarobotics.com/helpFiles/en/regularApi/simTransformVector.htm

omcandido commented 6 years ago

Hi! Thanks for your interest in this plugin.

That is an interesting approach, getting rid of the translation vector right before doing the transformations. The rest of the code should work just fine.

If you don't need the global pointcloud, that seems a valid workaround. If you want both, you can just add an additional transformation after the full revolution is obtained.

I don't work with ROS right now, so it would take me a while to install everything and check it. You are more than welcome to open a new branch with this implementation, though. When I have the time, I will check it out and merge it into the master branch adding the option of using local/global pointcloud.

Thanks for your input!

Regards