필터 지우기
필터 지우기

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

조회 수: 1 (최근 30일)
Yanzhou Wang
Yanzhou Wang 2023년 11월 27일
답변: Yanzhou Wang 2024년 1월 23일
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.)?

답변 (2개)

Ashutosh Thakur
Ashutosh Thakur 2023년 12월 14일
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 2024년 1월 23일
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.

카테고리

Help CenterFile Exchange에서 2-D and 3-D Plots에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by