Gazebo Customized Plugin: Read the body names of contacts

2 views (last 30 days)
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 Comment
Yunsik Jung
Yunsik Jung on 5 Jul 2021
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

Sign in to comment.

Accepted Answer

Gaurav Bhosale
Gaurav Bhosale on 7 Jul 2021
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 Comment
Yunsik Jung
Yunsik Jung on 9 Jul 2021
Hi, Gaurav.
It works! Finally, I can get the body name using the changes that you mentioned.
Appreciate it!
Thank,
Yun

Sign in to comment.

More Answers (0)

Products


Release

R2021a

Community Treasure Hunt

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

Start Hunting!