Gazebo Customized Plugin: Read the body names of contacts

조회 수: 2 (최근 30일)
Yunsik Jung
Yunsik Jung 2021년 7월 1일
댓글: Yunsik Jung 2021년 7월 9일
Hello, all,.
Hello, all.
I have tried to read the contact information using the customized Gazebo Plugin with the virtual machine (Linux).
I have a trouble with reading the body names of contacts.
The MATLAB function that I used to convert the body names is:
function y = fcn(u)
y = string(char(u'));
end
When I tried to use the MATLAB function to convert it, I got the following error.
Unable to propagate the variable-size mode to the input of
'Gazebo Robot/MATLAB Function'.
This input expects a fixed-size mode. The variable-size mode originates from
'gazeboCosimControl_ys_v3/Gazebo Robot/Bus Selector13'.
Examine the configurations of 'Gazebo Robot/MATLAB Function' for one of
the following scenarios:
1. The block does not enable 'Support variable-size arrays'.
2. The input data 'u' does not enable 'Variable size'.
Component: Simulink | Category: Block error
This is because the body_*_names are 'variable' mode instead of 'fixed' mode.
Here is the bus editor and my simulink model for your review.
Do you have any ideas to solve this issue?
Thank you in advance!
Yun
  댓글 수: 1
Yunsik Jung
Yunsik Jung 2021년 7월 5일
In addition to the above, when I tried to read the body_name directly using the Display block, I got the following result.
It seems to show the elemets' IDs instead of names (characters).
Thanks,
Yun

댓글을 달려면 로그인하십시오.

채택된 답변

Gaurav Bhosale
Gaurav Bhosale 2021년 7월 7일
Hi Yunsik,
As mentioned in the error,
" Examine the configurations of 'Gazebo Robot/MATLAB Function' for one of
the following scenarios:
1. The block does not enable 'Support variable-size arrays'.
2. The input data 'u' does not enable 'Variable size'."
The input 'u' of "MATLAB Function" should be variable size.
To make that, you need to do following changes in "MATLAB Function" "Model Explorer"
You can open "Model Explorer" by right click on "MATLAB Function" block.
Thanks.
  댓글 수: 1
Yunsik Jung
Yunsik Jung 2021년 7월 9일
Hi, Gaurav.
It works! Finally, I can get the body name using the changes that you mentioned.
Appreciate it!
Thank,
Yun

댓글을 달려면 로그인하십시오.

추가 답변 (0개)

카테고리

Help CenterFile Exchange에서 Gazebo Co-Simulation에 대해 자세히 알아보기

제품


릴리스

R2021a

Community Treasure Hunt

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

Start Hunting!

Translated by