Hi
I am getting data of velodyne sensor. But when I plot the same data then the location of the objects are not same as in the vrep scene. The objects are at different location e.g the object is at location [1, 2, 3] in vrep scene but it is at location [3, 2, 5] in plot . Could you please draw some insights related to this automatic data transformation happening in the simulator?
sensing function from the script of Vrep is as follows:
function sysCall_sensing()
if isActive==false then
return
end
isActive=false
data=simVision.handleVelodyneVPL16(h,sim.getSimulationTimeStep())
-- 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
for j=1,4,1 do
m=sim.getObjectMatrix(visionSensorHandles[j],-1)
point32 = {}
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)
point32[i+1]={x=d[1], y=d[2], z=d[3]}
end
sim.insertPointsIntoPointCloud(ptCloud,0,data)
-- Publish the Lidar PointClouds to ROS Topic
if not pluginNotFound then
pub_data={}
pub_data['header']={stamp=sim.getSystemTime(),frame_id="velodyneVPL"..j}
pub_data['points']=point32
print()
print("published velodyne data")
simROS.publish(lidar_pub,pub_data)
simROS.sendTransform(getTransformStamped(visionSensorHandles[j],'velodyneVPLSensor'..j,-1,'world'))
end
end
end
output of Velodyne sensor
Re: output of Velodyne sensor
In the Velodyne sensor script there is a section that illustrates how to display points from the Velodyne yourself. Have you tried that one? Are the points correctly displayed?
Cheers
Cheers