The difference between summit and turtlebot?

hi,
what’s the difference between the both ? then why are they both defined in the same method together :
def init(self, robot_name=“turtlebot”):
rospy.init_node(‘robot_control_node’, anonymous=True)

    if robot_name == "summit":

Hi @sumerfat, These topics are covered in the ROS basics in 5 Days course, which will be the next course you will be doing right after this (Python Basics).

However, regarding your query, the difference is simple. The robot will have to communicate in ROS somehow, so they use these concepts called topics(explained in ROS basics in 5 Days course). Basically, each robot will have a set of user defined topic that is unique to it, and when we send command through these topics, the robot does stuff like moving forward.

In case of summit :

cmd_vel_topic = "/summit_xl_control/cmd_vel"

In case of turtlebot:

cmd_vel_topic='/cmd_vel'

You can seen them in the class you mentioned :

    if robot_name == "summit":
        rospy.loginfo("Robot Summit...")
        cmd_vel_topic = "/summit_xl_control/cmd_vel"
        # We check sensors working
        self._check_summit_laser_ready()
    else:      
        rospy.loginfo("Robot Turtlebot...")      
        cmd_vel_topic='/cmd_vel'
        self._check_laser_ready()

so by using the below code, we are simply setting these unique topics based on the robot we are using at the time.

Topics are kind of the core concepts in ROS and require its own course to learn it better( and will be explained in ROS Basics in 5 days.) For now, focus only on python basics, since that is why the course Python basics course was written for.

Hope i answered you query and welcome to the community :slight_smile:

2 Likes

Great answer @Joseph1001 ! Thanks for helping out the community.

3 Likes

thank you for the answer, I am already on ex 4.1 :slight_smile:
from robot_control_class import RobotControl
import time
robotcontrol = RobotControl(robot_name=“summit”)
where we should enter the summit name as argument so I didn’t understand why we should enter the name here thats why I woundered about the difference, it didnt work calling RobotControl() like the other excercises before in other units

@sumerfat, glad it was helpful. :slight_smile:. Keep grinding, ROS has a steep learning curve, so little difficulty in the initial days is expected.

In case you have any future doubts, the chances are that someone else has already posted that on the group, if not, you can always post a new topic.

Again, welcome to the community

2 Likes

sure, I searched already, but there was no exactly similar question, please more to the question , on ex 4.1 we entered the name of robot as argumernt to the class RobotControl :slight_smile: robotcontrol = RobotControl(robot_name=“summit”) .
how and why is that while in the defintion of the class it takes no arguments:
class RobotControl():

def __init__(self, robot_name="turtlebot"):

    rospy.init_node('robot_control_node', anonymous=True)

    if robot_name == "summit":

the option of robots name come in the method init , so how could be entered when we called RobotControl on ex4.1 ?

Hi @sumerfat ,This concept is called constructors of a class, and is discussed in the very next unit ,Unit 5 Python Classes and Methods. i suggest you complete unit 5 and come back to unit 4 after.

However, The above is the code for the constructor of the class. Constructor is a small piece of code that runs whenever a new class object is created. This is also where the arguments of the class are received.

So when you create an object with robotcontrol = RobotControl(robot_name="summit"), we are actually calling the constructor and passing the arguments to it.

2 Likes