I’ve done ROS basics, so I shouldn’t be struggling with topics, but I think I am struggling with the way this exercise is worded. Can someone please tell me what I am doing wrong? This is the source code for my publisher:
#! /usr/bin/env python
import rospy
from geometry_msgs.msg import Twist
I have done this course and I have not had any issues. The code does not actually have any issues as far as I see.
Let me help you understand it.
You have a publisher that publishes twist command into /twist_vels topic. Here the /twist_vels topic is a dummy topic that you have created - it will NOT make the robot move.
You have a subscriber that receives the twist command that is posted on /twist_vels topic.
In the subscriber, you convert the received twist command and decompose the linear velocity X and angular velocity Z into velocities for the wheels Vl and Vr.
Finally, you publish left wheel velocity Vl into /left_wheel_controller/command topic and similarly Vr for right wheel - this would eventually make the robot move.
Basically, this example shows you how publishing to /cmd_vel works. The background of what happens to the robot after sending a twist command.
I hope my explanation helped you understand this better. Let me know if you still need clarification.
Thank you! Your response helped me realize that I was atleast on the right track. I had to do msg.linear.x and switch my message type in the publishers to Float64.