Collisions in 3D World Editor with Matlab and without Simulink

2 visualizaciones (últimos 30 días)
Blanca Larraga
Blanca Larraga el 17 de Jul. de 2020
Respondida: Muhammet Dabak el 11 de Nov. de 2020
Hi, I have a robotic arm which moves thanks to the connection of the model in 3D World Editor and a GUIDE interface developed. Now I want to introduce an object and when the object is touched, this could be moved. I started incorporating a LinePick Sensor in which I included the object in which the sensor is incorporated and the object to be touched. In order to check that this works, I wrote the following code but the sensor does not seem to work:
CODE
global world
col=vrnode(world,'Sensor_1_1');
color=vrnode(world,'PieceColor');
if col.enabled=='True'
color.diffuseColor = [1 0 0];
color.emissiveColor = [1 0 0];
color.specularColor = [1 0 0];
end
Any ideas?
Thank you very much in advance.
Blanca

Respuestas (1)

Muhammet Dabak
Muhammet Dabak el 11 de Nov. de 2020
enabled is determines that sensor is being used or not.
You should use .isActive property to check sensor flag is on or not.
if col.isActive == 1
But be aware that this LinePickSensor can detect objects with their geometry.
For further questions, please ask.

Etiquetas

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by