First of all, sorry about my english, I'm french ;)
So, I would like to control the V-rep Quadricopter through Matlab/Simulink. I use shared memory to send the quadricopter position and orientation. But I have an issue : the orientation function returns nil values I think. I use addStatusbarMessage to check the values : position is ok but orientation not (incorrect type for the addStatusbarMessage arguments).
Here is the code :
Code: Select all
if (sim_call_type==sim.syscb_sensing) then
-- quadAttitude
position=sim.getObjectPosition(d,-1)
orientation=sim.getObjectOrientation(d,-1)
for i=1,3,1 do
pos_or[i]=position[i]
sim.addStatusbarMessage(pos_or[i])
end
for i=4,6,1 do
pos_or[i]=orientation[i]
sim.addStatusbarMessage(pos_or[i])
end
data_write=sim.packFloatTable(pos_or,0,6)
result=simExtShareMemoryWrite(floatMem_OUT,data_write)
end
Thanks in advance and have a nice day !