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

1 回表示 (過去 30 日間)
Setthivadee
Setthivadee 2023 年 10 月 23 日
コメント済み: Setthivadee 2023 年 11 月 5 日
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.

採用された回答

Suresh Maddina
Suresh Maddina 2023 年 10 月 27 日
編集済み: Suresh Maddina 2023 年 10 月 27 日
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)
  1 件のコメント
Setthivadee
Setthivadee 2023 年 11 月 5 日
Thank you so much for your help. Its working.

サインインしてコメントする。

その他の回答 (0 件)

カテゴリ

Help Center および File ExchangeSpecialized Messages についてさらに検索

Community Treasure Hunt

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

Start Hunting!

Translated by