Question about selecting beam of laser in python

Hi everyone, it’s my first day at learning from Construct and bugs​:bug::bug: have already started attacking me
ok i want to receive the laser beam readings from the back side of robot. so according to tutorial, if i put 719, i get the reading from left, so that means if i put 1079, then i should get reading from back side. but it returns with error. can anyone explain why is that so and how can i receive the reading from back side. I’m currently on Unit 2: Python Essentials

P.S.: Why it’s 719 and not 720(i’m new to it so forgive me for being stupid​:blush:)

Hi @SEA_ROVER
A very warm welcome to the Construct community!!!`
Ok so your first question is that u want to receive laser beam data from the robot’s back side but when u put 1079 in get_laser function, u receive an error.
Well, u should read the tutorial carefully. It has the following image that shows the laser maximum range which is 0 -719.

There are other robots that cover the whole circular region, but it’s yr present bot’s limitation. So u can try this thing with the upcoming bots.

Your second question was that **why it’s 719 and not 720. Well answer to it is that the range started from 0, so if we count 720 divisions starting from 0, then we our counting would stop at 719, not 720. For example, the 24 hr clock format, we never have 24:00 as it becomes 00:00 but we have 23:59.
Hope this helps!!!
Regards,
Awais Adis

3 Likes

Ohh I see, my bad!!
I would have missed it in the buzz.
very much thanks to u @Awais_Adis

1 Like

Hi, @SEA_ROVER!

To add to the response by @Awais_Adis, this also comes from the design of the robot itself where it can accommodate 720 points spanned over 180 degrees of vision as shown in his diagram. Therefore, if you want the robot to look or record the distances from the laser beams from its rear, that would entail making the robot rotate until the field that you would like to measure would be well within its field of vision.

Just to further add, there are also robots that are equipped with 360-degree LiDAR sensors which would essentially allow for the behavior that you are pertaining to. Do be sure to check them out as well!

Regards,
Christian

This topic was automatically closed 5 days after the last reply. New replies are no longer allowed.