Clear Filters
Clear Filters

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

1 view (last 30 days)
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.)?

Answers (2)

Ashutosh Thakur
Ashutosh Thakur on 14 Dec 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 on 23 Jan 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.

Categories

Find more on 2-D and 3-D Plots in Help Center and File Exchange

Community Treasure Hunt

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

Start Hunting!