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

1 vue (au cours des 30 derniers jours)
Setthivadee
Setthivadee le 23 Oct 2023
Commenté : Setthivadee le 5 Nov 2023
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.

Réponse acceptée

Suresh Maddina
Suresh Maddina le 27 Oct 2023
Modifié(e) : Suresh Maddina le 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)

Plus de réponses (0)

Catégories

En savoir plus sur Specialized Messages dans Help Center et File Exchange

Community Treasure Hunt

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

Start Hunting!

Translated by