Collisions in 3D World Editor with Matlab and without Simulink

1 vue (au cours des 30 derniers jours)
Blanca Larraga
Blanca Larraga le 17 Juil 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

Réponses (1)

Muhammet Dabak
Muhammet Dabak le 11 Nov 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.

Catégories

En savoir plus sur Startup and Shutdown dans Help Center et File Exchange

Community Treasure Hunt

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

Start Hunting!

Translated by