It is very interesting. Thank you very much. Could you tell me haw the print works . For example you write " Drive forward" "Come too close,drive right" is it like module or we can write whatever we wants. For example if i write print " go right side " did the robot understand it .
Thank you Felege, glad you liked the video. :) The print command is to print the message on output terminal, it is simply there for humans to read and understand what is happening. The way robot movements are decided by the left and right speed which are given to motor. For example to drive robot forward, I gave same speed to both left and right motor. For turning left, I gave less speed to left motor and more to right motor. You might benefit from watching this video where I explain this in detail with diagrams. ua-cam.com/video/CDOrTKQAOqs/v-deo.html
Hello! Great video, I am doing a project where I need the robot to stop in a specific spot in a maze but I cannot get the robot to stop. I also saw another comment about this in this video but I cannot manage to put in a colored spot, What can I do? I appreciate your help!
You might have used incorrect number of spaces. Can you share your code & webots project on the slack channel so I can take a look? Link - sendfox.com/lp/1k5w9d
How we can increase its speed when e puck moving in forward direction, then slow a little bit while turning and then moving to max speed while moving forward?
As shown in the video, during different phase we are moving in forward direction or turning. You can change the speeds there. You will have to fine tune it to ensure the robot doesn't end up driving too far away from wall or too close to the wall.
@@KajalGada So every time I add an object in the world, the 3D axis orientation of it is X to the left/right, Y to the front or back and Z to the top or bottom. Now how can this be changed so that the default orientation has Y to the top or bottom and Z to the front or back?
@@KajalGada Thanks for that, and another question is I coded my robot, I painstakingly follow your video but, unfortunately the robot did not move even a one inch. what is the problem please?
One of things you can do is add a marker (or beacon) to the center spot. Then as the robot is driving around, when it detects the marker, it will stop. You can do a simple colored spot on the floor and have it detected with IR sensors. Let me know if that works for you 🙂
I use >80 to detect the wall. Explained the concept here - ua-cam.com/video/tHENC-HEIW8/v-deo.html IR sensors basically detect reflected light. Depending on distance between robot & wall, color of wall, surrounding light, etc you will get a reading. Explained this concept here - ua-cam.com/video/D0jhvFZJ5Ok/v-deo.html For this setup, a value higher than 80 means wall is detected next to robot.
Hi! How do I make the robot to avoid objects? If I add a rock near the wall, the robot get stuck. Is it possible to make he dettect and bypass the rock?
Can you check if you updated the robot in scene tree to use your code? Make sure to save the world after you do that. Another thing to check is the speed you are giving the robot.
Hello, great video very useful but I have a question, I wrote thr exact same code you did and I got an error where it's telling me to use .getDevice instead of .getMotor which I did then it tells me that the nonetype had no attribut 'setPosition' How can I fix this ? 💖
what if I want to add more robot in that situation, like I want 4 robot move together while avoiding the collision. how can I add more robot in webots and make them communicate with each other through leader-follower method? can you help me in this problem?
@@christinairene1932 You will have to tweak your code. Cause in webots you are most likely using the robot class to access robot. You would have to tweak that to access the real world robot libraries.
@@KajalGada like I am using coppaliasim simulation software for my project my task is to use 2 khepera 3 robots and create a cooperation between them so they could like complete the task together for example to push a heavy object together .Can you help me with that like how should i program the robots to create a cooperation?
@@remaanmechatronics7092 I haven’t used coppaliasim (vrep) in a long time and am not aware of all of its functionality. Khepers is also a robot. So I am not sure about your problem statement here: is it 2 khepera & 3 other robots? I am not sure if ROS is supported with copaliasim. If it is, a good idea would be to use ROS to have one of your robots as the main point. Using ROS you can issue commands to rest of the robot and also obtain information on each robots state. All the best. 👍🏻
@@shreyanand2226 Here is an idea. You could use the distance travelled by e puck as a way to measure length and width. Then the area would be length by width. Given you know epuck is traveling at 6.28 m/s, simply track the time it drove before turning. Speed = Distance/ time => speed * time = distance. Hope that helps. :)
lidar - How to use Lidars in Webots? // Webots Lidar Code in Python Tutorial ua-cam.com/video/7A9h7d-XWSA/v-deo.html Code in C - ua-cam.com/video/ni5NXoQ2-6Q/v-deo.html
Thank you. This was a good playlist of tutorials and were quick a sucient. Thank you.
Glad to hear it was helpful. Thank you for the comment. :)
Thank you for sharing such a great content.
Can you share same kind of video on navigation with camera
please i need your help i have a problem in the webots my robot didn't move
please hlep
Thank you for sharing.
Thank you for the comment, glad this video helped you 🙂
please how can i get the epuck documentation of this video
It is very interesting. Thank you very much. Could you tell me haw the print works . For example you write " Drive forward" "Come too close,drive right" is it like module or we can write whatever we wants. For example if i write print " go right side " did the robot understand it .
Thank you Felege, glad you liked the video. :)
The print command is to print the message on output terminal, it is simply there for humans to read and understand what is happening.
The way robot movements are decided by the left and right speed which are given to motor.
For example to drive robot forward, I gave same speed to both left and right motor.
For turning left, I gave less speed to left motor and more to right motor.
You might benefit from watching this video where I explain this in detail with diagrams. ua-cam.com/video/CDOrTKQAOqs/v-deo.html
Hello! Great video, I am doing a project where I need the robot to stop in a specific spot in a maze but I cannot get the robot to stop.
I also saw another comment about this in this video but I cannot manage to put in a colored spot, What can I do?
I appreciate your help!
What are you doing to detect the colored spot?
@@KajalGada I use ground sensors to detect the colored spot
An excellent series of videos: informative and enjoyable.
Thank you for the comment, glad the video is helpful to you :)
Can you help me, my error was the line 11 which is the basic timestep with an IndentationError: expected an indented block. Thank you so much!
You might have used incorrect number of spaces.
Can you share your code & webots project on the slack channel so I can take a look?
Link - sendfox.com/lp/1k5w9d
How we can increase its speed when e puck moving in forward direction, then slow a little bit while turning and then moving to max speed while moving forward?
As shown in the video, during different phase we are moving in forward direction or turning. You can change the speeds there. You will have to fine tune it to ensure the robot doesn't end up driving too far away from wall or too close to the wall.
Can we use this for avoiding other types of obstacles?
Yes. You can use this logic with modifications to avoid obstacle and drive around them.
Hi, could you please tell me how to reconfigure the 3D-axis - like changing Z up to Y up?
not sure what you mean
@@KajalGada So every time I add an object in the world, the 3D axis orientation of it is X to the left/right, Y to the front or back and Z to the top or bottom. Now how can this be changed so that the default orientation has Y to the top or bottom and Z to the front or back?
Hello thank you for the video, my question is how can one download the maze? and how can he upload it in the webot? Thank you
Glad you found the video helpful.
download process explained here - ua-cam.com/video/t_xCXIRQUns/v-deo.html
@@KajalGada Thanks for that, and another question is I coded my robot, I painstakingly follow your video but, unfortunately the robot did not move even a one inch. what is the problem please?
how to stop the bot at the center if I have a rectangular spiral maze
One of things you can do is add a marker (or beacon) to the center spot. Then as the robot is driving around, when it detects the marker, it will stop.
You can do a simple colored spot on the floor and have it detected with IR sensors.
Let me know if that works for you 🙂
you did it?
Very nice and beneficial video, can you do obstacle avoidance line follower robot please
Hi Hasan,
That would be an interesting project to do. I currently have a videos that I am working on, this could be a great project for the future.
Why do you use ">80" for sensor data value?
I use >80 to detect the wall. Explained the concept here - ua-cam.com/video/tHENC-HEIW8/v-deo.html
IR sensors basically detect reflected light. Depending on distance between robot & wall, color of wall, surrounding light, etc you will get a reading. Explained this concept here - ua-cam.com/video/D0jhvFZJ5Ok/v-deo.html
For this setup, a value higher than 80 means wall is detected next to robot.
Thanks for the video. Can you also show how the camera of the e-puck robot can be enabled with python?
Yeah I can make a video on that
@@KajalGada yes please we will wait for this video and with Lidar sensor.
Hi! How do I make the robot to avoid objects? If I add a rock near the wall, the robot get stuck. Is it possible to make he dettect and bypass the rock?
Yes it is. Use the other distance sensors to detect objects near robot and avoid them as well.
Does require code modification.
My robot doesn't move but code is working. Can u help please ?
Can you check if you updated the robot in scene tree to use your code? Make sure to save the world after you do that.
Another thing to check is the speed you are giving the robot.
nice
Thank you, glad it helped you out. :)
Hello, great video very useful but I have a question, I wrote thr exact same code you did and I got an error where it's telling me to use .getDevice instead of .getMotor which I did then it tells me that the nonetype had no attribut 'setPosition'
How can I fix this ? 💖
Hi Sarah,
Sorry for the late reply. What version of webots are you using?
@@KajalGada i have the same problem on R2022a
hello for everyone facing this problem try this code
left_motor = robot.getDevice('left wheel motor')
right_motor = robot.getDevice('right wheel motor')
left_motor.setPosition(float('inf'))
right_motor.setPosition(float('inf'))
left_motor.setVelocity(0.0)
right_motor.setVelocity(0.0)
what if I want to add more robot in that situation, like I want 4 robot move together while avoiding the collision. how can I add more robot in webots and make them communicate with each other through leader-follower method? can you help me in this problem?
To add more robots follow the same process.
For communication amongst the robots, considering using ROS with Webots
@@KajalGada alrightt. Thanks for the replyy 😁
@@KajalGada how do we apply this webots simulation to real robot?
@@christinairene1932 You will have to tweak your code. Cause in webots you are most likely using the robot class to access robot. You would have to tweak that to access the real world robot libraries.
can someone send me the code i dont know why i all the time make mistakes .If it is possible pleas send
Do you have a Patreon account yet? I would like to support your excellent videos.
Thank you for the kind words. At the moment, I don't have a Pateron account. Maybe something in the future. :)
It is showing the following error:
AttributeError: 'NoneType' object has no attribute 'setPosition'
Make sure your robot motor name is same in scene tree & code.
hello, what does same in scene tree and code mean?
how do I create a communication between robots like khepera to cooperate and complete the task.
Could you expand and provide more details?
@@KajalGada like I am using coppaliasim simulation software for my project my task is to use 2 khepera 3 robots and create a cooperation between them so they could like complete the task together for example to push a heavy object together .Can you help me with that like how should i program the robots to create a cooperation?
@@remaanmechatronics7092 I haven’t used coppaliasim (vrep) in a long time and am not aware of all of its functionality.
Khepers is also a robot. So I am not sure about your problem statement here: is it 2 khepera & 3 other robots?
I am not sure if ROS is supported with copaliasim.
If it is, a good idea would be to use ROS to have one of your robots as the main point. Using ROS you can issue commands to rest of the robot and also obtain information on each robots state.
All the best. 👍🏻
@@KajalGada No, no the robot name is khepera 3 . and let me try ROS. by the way thank you for helping. God bless you.
@@remaanmechatronics7092 I see what you mean. Now that I read it, it is funny how I read it before.
Thank you and all the best to you too.
How to setup motors configuration for epuck?
what do you mean? The motors are already configured & can be used as is
@@KajalGada so there is not need to separately configure the epuck motor, right?
@@71_a_siddharthjadhav70 yeah
Hello, in code it gives attribute error at setPosituon function...
Hi Akshay,
can you share the code you wrote?
@@KajalGada yes
from Controler import Robot
def run_robot(robot):
#get the timestep
timestep = int(robot.getBasicTimeStep())
max_speed = 6.28
#Enable Motors
left_motor = robot.getMotor("Left Wheel robot")
right_motor = robot.getMotor("Right Wheel robot")
left_motor.setPosition(float('inf'))
left_motor.setVelocity(0.0)
right_motor.setPosition(float('inf'))
right_motor.setVelocity(0.0)
#Enable Proxymity sensors
prox_sensors = []
for ind in range(8):
sensor_name = 'ps' + str(ind)
prox_sensor.append(robot.getDistanceSensor(sensor_name))
prox_sensors[ind].enable(timestep)
# Main loop:
#-perform simulation steps until webots is stopping the controller
while robot.step(timestep) != -1:
#read the sensors:
for ind in range(8):
print("ind: {}, val: {}". format(ind, prox_sensors[ind].getValue()))
#process sensor data here.
left_wall = prox_sensors[5].getValue() > 80
left_corner = prox_sensors[6].getValue()>80
front_wall = prox_sensors[7].getValue() > 80
#process sensor data here.
left_speed = max_speed
right_speed = max_speed
if front_wall:
print("Turn right in place")
left_speed = max_speed
right_speed = -max_speed
else:
if left_wall:
print("Drive Forward")
left_speed = max_speed
right_speed = max_speed
else:
Print("Turn Left")
left_speed = max_speed/8
right_speed = max_speed
if left_corner:
left_speed = max_speed
right_speed = max_speed/8
#Enter here functions to send actuator commands, like:
left_motor.setVelocity(left_speed)
right_motor.setVelocity(right_speed)
# Enter here exit cleanup code.
if__name__ == "__main__":
#create the robot Instance.
my_robot = Robot()
run_robot(my_robot)
@@ajoshi2663 Your motor namers are incorrect.
left_motor = robot.getMotor('left wheel motor')
right_motor = robot.getMotor('right wheel motor')
Ok I will change and try one more time..Thanks
@@ajoshi2663 Let me know if that works.
Hi ,where can I get the code?
It is explained in the video
Can u give full code
It is in the video.
Hello I have doubt if I made a rectangle with wall and follow this code is there any way e puck calculate the area of the particular rectangle
@@shreyanand2226 Here is an idea.
You could use the distance travelled by e puck as a way to measure length and width. Then the area would be length by width.
Given you know epuck is traveling at 6.28 m/s, simply track the time it drove before turning.
Speed = Distance/ time
=> speed * time = distance.
Hope that helps. :)
Wall following robot history
Not sure what you mean
po mc
Hi, what's the controller code if we add Lidar and enable the camera to the robot?
lidar - How to use Lidars in Webots? // Webots Lidar Code in Python Tutorial
ua-cam.com/video/7A9h7d-XWSA/v-deo.html
Code in C - ua-cam.com/video/ni5NXoQ2-6Q/v-deo.html