フィルターのクリア

Matlab and ROS integration

6 ビュー (過去 30 日間)
Imran
Imran 2023 年 10 月 7 日
編集済み: Imran 2023 年 10 月 21 日
I have created matlab code where robot does exploration, the map is binary occupancy map (20x20m). Now I am trying to integrate it with ROS2
I have few questions
1. How can I linearly transform map, so that matlab map dimensions matches the gazebo map for turtlebot3.
2. does turtlebot3 requires cmd_vel for its rotation or movement or we can make it work with /position as well.
subscriber publisher code has been made where it recives /positions from matlab. It has been checked with
ros2 topic echo /position.
Though these things are working, but my tb3 is not moving.

採用された回答

Yatharth
Yatharth 2023 年 10 月 16 日
Hi Imran,
I understand that you are trying to integrate MATLAB with ROS2 and want to know if you can linearly transform your map. You are also trying to resolve the issue of your Thunderbot3 not moving.
1. Linear Transformation of the Map:
  • First, ensure that the dimensions of your MATLAB map match the dimensions of the Gazebo map for the Turtlebot3. If they don't match, you'll need to rescale your MATLAB map to match the size of the Turtlebot3's map.
  • You can use the "imresize" function in MATLAB to resize your map. For example, if your MATLAB map is 20x20m and the Turtlebot3's map is 10x10m, you can resize your MATLAB map to match the Turtlebot3's map size using:
resizedMap = imresize(originalMap, [10 10]);
2. Turtlebot3 Movement:
I hope this helps.
  3 件のコメント
Yatharth
Yatharth 2023 年 10 月 18 日
The "geometry_msgs/Twist" message is the correct message type to control the Turtlebot3's movement. The "geometry_msgs/Twist" message contains linear and angular velocities, which are required to control the robot's motion.
On the other hand, the "geometry_msgs/Point" message only contains x, y, and z coordinates, which are not sufficient to control the Turtlebot3's movement directly. That's why you are seeing all zero values when you check the "/cmd_vel" topic.
To control the Turtlebot3 using your MATLAB code, you need to modify it to publish "geometry_msgs/Twist "messages instead of "geometry_msgs/Point" messages. The "geometry_msgs/Twist" message should contain appropriate linear and angular velocities for the desired movement.
You can refer to the link below for more help.
Imran
Imran 2023 年 10 月 20 日
編集済み: Imran 2023 年 10 月 21 日
Hi
thats really helpful. since I am new in ROS, and I do understand that my x,y are robot position not linear angular velocities. Can you show me direction how can I change my points to velocities? cause I followed the link you shared still when I check my linear & angular velocities are zero. "ros2 topic echo /cmd_vel"

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

その他の回答 (0 件)

カテゴリ

Help Center および File ExchangeNetwork Connection and Exploration についてさらに検索

タグ

Community Treasure Hunt

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

Start Hunting!

Translated by