Gazebo Customized Plugin: Read the body names of contacts

1 次查看(过去 30 天)
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 个)

产品


版本

R2021a

Community Treasure Hunt

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

Start Hunting!

Translated by