Why is it necessary to use get_laser_summit() in a function and not get_laser()

I do not understand why is it necessary to use get_laser_summit() function inside a function. I looked into the source file and observed that both the functions are subscribed to different topics but their function is similar. Can somebody please explain it in a little detail?

Hi @dhruvil9121999,

welcome to our community.

You are referring to this part of the code, am I right?

def get_laser_values(a,b,c):
    r1 = robotcontrol.get_laser_summit(a)
    r2 = robotcontrol.get_laser_summit(b)
    r3 = robotcontrol.get_laser_summit(c)

The reason why we call get_laser_summit instead of get_laser is:

IMPORTANT NOTE: As you can see, we have introduced a new function called get_laser_summit(). This function works exactly the same as the get_laser() function, but it is prepared to work with the Summit XL simulation (because the laser topics have different names).

But I see your point, we could just pass a parameter to the get_laser function specifying the topic to subscribe to.

Please let us know in case you have further questions.

Keep pushing your ROS Learning.