Conversion to double from struct is not possible.

22 visualizaciones (últimos 30 días)
Massimo Lucia
Massimo Lucia el 5 de Mayo de 2020
Comentada: Massimo Lucia el 7 de Mayo de 2020
Can you please help me with this error message?
Conversion to double from struct is not possible.
Error in STABLE (line 80)
qs(i,:) = qSol;
Find attached the STABLE.m
This is what i get in the command window:
qSol =
1×7 struct array with fields:
JointName
JointPosition

Respuesta aceptada

Ameer Hamza
Ameer Hamza el 5 de Mayo de 2020
Chage following lines
Line 4:
robot = rigidBodyTree('DataFormat', 'row');
Line 85:
show(robot,qs(1,:));
Line 95
show(robot,qs(i,:),'PreservePlot',false);
  5 comentarios
Ameer Hamza
Ameer Hamza el 6 de Mayo de 2020
Do it like this
robot = importrobot('xxxxxxx.urdf');
robot.DataFormat = 'row'; % or 'column'

Iniciar sesión para comentar.

Más respuestas (1)

Bjorn Gustavsson
Bjorn Gustavsson el 5 de Mayo de 2020
This is obviously an operation that's not supported. If you look at the contens of one struct, you might find that the Jointname is a string, or a char-array. Those might be of different lengths (Al Dee or Vishvanatan Axelsson-Johnsson) - this makes it difficult to convert into a double array. Try with the fields of the struct separately:
Allpos = [qSol(:).JointPosition];
Allnames = char(qSol(:).Jointname)
HTH

Categorías

Más información sobre Publishers and Subscribers en Help Center y File Exchange.

Etiquetas

Productos


Versión

R2020a

Community Treasure Hunt

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

Start Hunting!

Translated by