Clear Filters
Clear Filters

How to change data type from LaserScan Msg with ROS Read scan block

2 views (last 30 days)
Hello, I am trying to creat the simulink model to Run with Gazebo using ROS. When its come to the Scan data I struggled with connect Read scan data from ROS Laserscan Msg. I want to connect these Msg to the VFH block as shown in Pictures. I had try this method before with Gazebo block and its run perfectly. However, when I want to use ROS Msg I cannot change data type to be "Double" from Read Scan Msg "Single" type.
Can anyone suggest me the way to correct this type or How can I use other block or something
The one that I run with Gazebo is be like this. This one I am using the Read Lidar scan
Thank you so much in advance.

Accepted Answer

Suresh Maddina
Suresh Maddina on 27 Oct 2023
Edited: Suresh Maddina on 27 Oct 2023
Hi, It is my understanding that you are trying to provide the Ranges, Angles of "single" data type, and TargetDir of "double" data type to "Vector Field Histogram" block.
All the inputs to" Vector Field Histogram" block are expected to be of the same data type. Either convert the TargetDir to single data type, or convert Ranges, Angles to double data type.
You can use Data Type conversion block to convert from double to single or vice-versa (Convert input signal to specified data type - Simulink - MathWorks)

More Answers (0)

Categories

Find more on Publishers and Subscribers in Help Center and File Exchange

Community Treasure Hunt

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

Start Hunting!