Simulink Robotics System Toolbox
1 次查看(过去 30 天)
显示 更早的评论
I would like to deploy the code on Ubuntu 16.02 + ROS which prepared the CAN communication model created on simulink separately using the code which uses the CANUSB device made by Lawicel in the URL below and is made available on the following URL. If I select "/ canrx" as the topic of the Subscribe block in the procedure in, and then select the Subscribe block again, an error such as an image will occur.
1. Place the ROS Subscribe block
2. Double click on it
3. Select "Select from ROS network"
4. Select the topic "/ canrx" on another PC's ROS network from "Select" on the right side of Topic:
5. Message type is automatically set to "canusb / CAN", apply, and press OK.
Of course "Configure ROS Network Addresses" can be connected to the ROS network of another PC without any problem, and the configuration parameters "Run hardware", "Target hardware resources", "Build option" "Edit" "Test" There is no error and the connection with the ROS network is good.
0 个评论
回答(1 个)
Cam Salzberger
2019-6-10
Hey Shundai,
Have you gone through the custom message support workflow to add that message type to MATLAB? It is selectable, because the ROS network exists, but if MATLAB doesn't recognize the message type, it can't make use of it.
If you're not sure, enter "rosmsg list" in the Command Window. If you see "canusb/CAN" in that list, then it has already been added.
-Cam
2 个评论
Cam Salzberger
2019-6-12
The basic idea is that you provide your message definition package to MATLAB, and MATLAB will be able to recognize your custom message. First install the Robotics Systems Toolbox Interface for ROS Custom Messages. Make sure you have the correct message definition package in a good location (needs the ".msg" definition files, as well as the package.xml file that defines the ROS package). Then follow the steps in this link, using rosgenmsg to point MATLAB to the custom message package folder, and adjusting the Java and MATLAB paths as instructed. Restart MATLAB, and you should be able to use the new custom messages.
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 Specialized Messages 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!