How to modify plotted SE(3) transformations for animation purposes

4 visualizaciones (últimos 30 días)
Yanzhou Wang
Yanzhou Wang el 27 de Nov. de 2023
Respondida: Yanzhou Wang el 23 de En. de 2024
I want to iteratively modify plotted SE(3) transformations generated by the built-in function plotTransforms() for a sequence of transformations, without closing and re-plotting an existing figure.
I know for objects returned by plot() or plot3(), point positions can be modified using the set() function, such as
set(obj, 'XData', x_data, 'YData', y_data)
however, I cannot find a straightforward way to set plotted transformations returned by plotTransforms() and have them reflected on the current figure.
Is the function plotTransforms() the correct function to use for my application? If not, is there an alternative of displaying SE(3) elements that allows me to iteratively set their properties (position, orientation, etc.)?

Respuestas (2)

Ashutosh Thakur
Ashutosh Thakur el 14 de Dic. de 2023
Hi Yanzhou,
I understand that you want to modify the plotted transformation without closing and re-plotting an existing figure.
Their are two possible suggestions which can be used to achieve the above objective:
  • You can try to link the workspace variables with plot such that if the workspace variables are modified then the subsequent plot linked to it also gets modified.
  • Instead of using the data linking feature, you can keep the plot synchronized with the workspace variables by setting the data source properties of the plotted object.
Please take reference from the following documentation link regarding the data linking and data source ways to update the plot dynamically:
I hope this helps you in resolving the issue.

Yanzhou Wang
Yanzhou Wang el 23 de En. de 2024
I was able to solve it by directly modifying the transformation matrices that's embedded deep down in the returned axis variable. Get current axis,
A = gca;
then set
A.Children(i).Children(j).Children.Matrix = newTransformationMatrix;
drawnow
where "i" is the index containing a MATLAB Group structure, and "j" is the index of transformation you want to modify.
However, doing so generates the following warning
Warning: The new value for the Matrix property may cause rendering problems.

Categorías

Más información sobre Animation en Help Center y File Exchange.

Productos


Versión

R2023b

Community Treasure Hunt

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

Start Hunting!

Translated by