Velodyne VPL-16 rotation issue
Posted: 30 Jun 2017, 15:59
Hello everyone.
I am having a small issue with the velodyne VPL-16 sensor that comes with V-REP.
I want to export its pointcloud to ROS. So, in my first steps, I add the velodyne to the scene, uncomment this code part:
and run the program. Everything runs ok.
However, I have to rotate the sensor 90 degrees with respect to its Y axis, due to my model geometry.
When I just rotate the sensor and run again the program, LUA code gives me this error:
I simply don't understand why the code stops working only because I have rotated the sensor.
Hope someone could help me.
Thank you a lot in advance.
I am having a small issue with the velodyne VPL-16 sensor that comes with V-REP.
I want to export its pointcloud to ROS. So, in my first steps, I add the velodyne to the scene, uncomment this code part:
Code: Select all
-- if we want to display the detected points ourselves:
if ptCloud then
sim.removePointsFromPointCloud(ptCloud,0,nil,0)
else
ptCloud=sim.createPointCloud(0.02,20,0,pointSize)
end
m=sim.getObjectMatrix(visionSensorHandles[1],-1)
for i=0,#data/3-1,1 do
d={data[3*i+1],data[3*i+2],data[3*i+3]}
d=sim.multiplyVector(m,d)
data[3*i+1]=d[1]
data[3*i+2]=d[2]
data[3*i+3]=d[3]
end
sim.insertPointsIntoPointCloud(ptCloud,0,data)
However, I have to rotate the sensor 90 degrees with respect to its Y axis, due to my model geometry.
When I just rotate the sensor and run again the program, LUA code gives me this error:
Code: Select all
[C]: in function 'insertPointsIntoPointCloud'
[string "SCRIPT velodyneVPL_16"]:32: in main chunk
Simulation stopping...
Lua runtime error: [string "SCRIPT velodyneVPL_16"]:32: One of the function's table size is not correct. (sim.insertPointsIntoPointCloud)
stack traceback:
Hope someone could help me.
Thank you a lot in advance.