Gazebo/ROS: Publishing to Set Model State, problem with strings and bus assignment
2 次查看(过去 30 天)
显示 更早的评论
Hello, I am having trouble publishing to the set model state topic using ROS/Gazebo, specifically regarding the model name field. I need to give a string as an input (the name of the model I am trying to modify) into the bus assignment, but am having trouble accomplishing this. So far, I have tried to use a constant block to set the string name but it did not work. I also tried using a blank message block, but that did not work either.
0 个评论
回答(1 个)
Sebastian Castro
2017-7-12
编辑:Sebastian Castro
2017-7-12
Working with strings in ROS/Simulink takes a little getting used to. You need to supply a vector of char (or uint8), as well as provide extra information about the length of the string you are sending so the receiving end knows how far along the max length (128 by default) to read.
I'd recommend checking out this example for ideas: https://www.mathworks.com/help/robotics/examples/work-with-ros-messages-in-simulink.html
- Sebastian
0 个评论
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 Gazebo Co-Simulation 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!