Change frame size in show(rigidbodyTree)
조회 수: 16 (최근 30일)
이전 댓글 표시
I'm working with a rigid body tree robot in MATLAB. The robot is fully built out using the steps outline here: https://www.mathworks.com/help/robotics/ug/build-a-robot-step-by-step.html. When I use:
show(robot)
I get a figure window with the robot. I'd like to change the thickness of the lines (if possible), or at minimum increase the size of the joint frames (which are so small that they are only visible if you zoom very close to the robot).
댓글 수: 0
답변 (2개)
Cam Salzberger
2019년 12월 16일
Hello Brian,
If you don't have a mesh model to show on the robot, and only have the body lines, I believe you can get access to the line objects. If you get a return value from the show function, it will return the axes object. If you check through the 'Children' property of the axes, you should be able to determine which of them is the lines for the robot itself (not the coordinate frame or other annotations), and you could modify the properties there. I haven't tested this out, but this may get you started in direction.
-Cam
댓글 수: 0
Payas Bahade
2019년 12월 26일
Hi Brian,
To change the line width of body frame, you can make use of axes handle returned by ‘show’ function as mentioned by Cam. Also, adding customized markers at body frame can help in making joints more prominent. I have written the below code for the same:
load exampleRobots.mat
config = homeConfiguration(puma1)
f1=show(puma1); %returning axes handle as f1
h=findall(f1); %finding all objects in figure
hlines=h.findobj('Type','Line'); %finding line object
%editing line object properties
n=size(hlines);
for i=1:n
hlines(i).LineWidth=2; %chanding line width
hlines(i).Color=[1 0 1];%changing line color
hlines(i).Marker='o';%changing marker type
hlines(i).MarkerSize=10; %changing marker size
end
You can customize the line properties as required by you. For more details on line properties, please refer this documentation link.
Hope this helps!
댓글 수: 1
Pete
2021년 3월 7일
Hi there,
the code you posted works perfectly to change the properties of the body lines!
But I can't figure out how to change the size of the actual frames, as Brian showed us in his illustration.
Do you have an idea how to manage that?
Sincerely
참고 항목
카테고리
Help Center 및 File Exchange에서 Manipulator Modeling에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!