knzinya
knzinya

Reputation: 1

Issue with Publishing Velocity Control from MATLAB to Turtlebot3 in ROS

I am new to the ROS framework. I am trying to control Turtlebot3 in Gazebo, which is installed on my Laptop 1 (Ubuntu), using MATLAB, which is installed on my Laptop 2 (Windows). I am having issues in publishing velocity control from MATLAB to Turtlebot3 on /cmd_vel topic.

The current state of the project is as follows:

  1. Laptop 1 has Turtlebot 3 in Gazebo on Ubuntu 20.04.6 LTS (focal) with ROS (noetic) distribution, and Laptop 2 has MATLAB R2020a on Windows 10.
  2. I connected Laptop 1 to the hotspot on the Laptop 2 and I am able to 'ping' between them.
  3. I am able connect with the ROS on Laptop 1 using the 'rosinit( ip address )' command on MATLAB in Laptop 4. This connection is working, because I am able to subscribe to /odom and /scan topics and collect pose and Lidar scanner measurements from Gazebo simulation (Laptop 1) to MATLAB (Laptop 2).
  4. The command 'rostopic echo \odom' works on both Laptops i.e., I am able to listen in to \odom topic which provides current pose of the Turtlebot3.

However, when I try to send velocity input from MATLAB on the topic /cmd_vel, the command 'rostopic echo /cmd_vel' on Laptop 1 does not receive information. But when I run the same command in MATLAB (Laptop 2) I can see the current velocity information being published.

As per my limited understanding, Laptop 1 (Ubuntu) is not able to listen to the /cmd_vel topic published by Laptop 2 (Windows).

I would be grateful if anyone can help me resolve this issue or suggest any solution. I am happy to provide more information if necessary. :slight_smile:

Upvotes: 0

Views: 62

Answers (1)

knzinya
knzinya

Reputation: 1

I was able to troubleshoot the problem. The firewall setting on my Windows Laptop were preventing MATLAB messages from reaching the ROS on Ubuntu. As soon as I turned off the firewall on Windows, my velocity commands started working. Thanks.

Upvotes: 0

Related Questions