Webots Tutorial Project Wall follower robot using e-puck // Controller code in Python

Поділитися
Вставка
  • Опубліковано 20 жов 2024

КОМЕНТАРІ • 93

  • @decreer4567
    @decreer4567 Рік тому +2

    Thank you. This was a good playlist of tutorials and were quick a sucient. Thank you.

    • @KajalGada
      @KajalGada  Рік тому

      Glad to hear it was helpful. Thank you for the comment. :)

  • @IRONMAN-mi4nt
    @IRONMAN-mi4nt 5 місяців тому

    Thank you for sharing such a great content.

  • @sirinxaxavier2287
    @sirinxaxavier2287 5 місяців тому

    Can you share same kind of video on navigation with camera

  • @bombastik-xj2sc
    @bombastik-xj2sc 6 місяців тому

    please i need your help i have a problem in the webots my robot didn't move
    please hlep

  •  3 роки тому

    Thank you for sharing.

    • @KajalGada
      @KajalGada  3 роки тому

      Thank you for the comment, glad this video helped you 🙂

  • @cashiefash1838
    @cashiefash1838 10 місяців тому

    please how can i get the epuck documentation of this video

  • @wediwelday1300
    @wediwelday1300 3 роки тому

    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 .

    • @KajalGada
      @KajalGada  3 роки тому

      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

  • @sandramezeridou9024
    @sandramezeridou9024 6 місяців тому

    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!

    • @KajalGada
      @KajalGada  6 місяців тому +1

      What are you doing to detect the colored spot?

    • @sandramezeridou9024
      @sandramezeridou9024 6 місяців тому

      @@KajalGada I use ground sensors to detect the colored spot

  • @johnryde6697
    @johnryde6697 3 роки тому

    An excellent series of videos: informative and enjoyable.

    • @KajalGada
      @KajalGada  3 роки тому

      Thank you for the comment, glad the video is helpful to you :)

  • @bladestorm1448
    @bladestorm1448 2 роки тому

    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!

    • @KajalGada
      @KajalGada  2 роки тому

      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

  • @prof.mitalideb5356
    @prof.mitalideb5356 3 роки тому +1

    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?

    • @KajalGada
      @KajalGada  3 роки тому +1

      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.

  • @JaienAbtahy
    @JaienAbtahy 3 роки тому

    Can we use this for avoiding other types of obstacles?

    • @KajalGada
      @KajalGada  3 роки тому

      Yes. You can use this logic with modifications to avoid obstacle and drive around them.

  • @mayureshshrikrishnan2830
    @mayureshshrikrishnan2830 2 роки тому

    Hi, could you please tell me how to reconfigure the 3D-axis - like changing Z up to Y up?

    • @KajalGada
      @KajalGada  2 роки тому

      not sure what you mean

    • @mayureshshrikrishnan2830
      @mayureshshrikrishnan2830 2 роки тому

      @@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?

  • @albashirbashir7559
    @albashirbashir7559 2 роки тому

    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

    • @KajalGada
      @KajalGada  2 роки тому +1

      Glad you found the video helpful.
      download process explained here - ua-cam.com/video/t_xCXIRQUns/v-deo.html

    • @albashirbashir7559
      @albashirbashir7559 2 роки тому

      @@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?

  • @vini_voni
    @vini_voni 3 роки тому +1

    how to stop the bot at the center if I have a rectangular spiral maze

    • @KajalGada
      @KajalGada  3 роки тому +1

      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 🙂

    • @GK-bp5od
      @GK-bp5od 6 місяців тому

      you did it?

  • @hasannabhan9488
    @hasannabhan9488 3 роки тому

    Very nice and beneficial video, can you do obstacle avoidance line follower robot please

    • @KajalGada
      @KajalGada  3 роки тому

      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.

  • @alexandrucristian7101
    @alexandrucristian7101 2 роки тому

    Why do you use ">80" for sensor data value?

    • @KajalGada
      @KajalGada  2 роки тому

      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.

  • @dogukany.2257
    @dogukany.2257 3 роки тому

    Thanks for the video. Can you also show how the camera of the e-puck robot can be enabled with python?

    • @KajalGada
      @KajalGada  3 роки тому +2

      Yeah I can make a video on that

    • @hananabd8517
      @hananabd8517 3 роки тому

      @@KajalGada yes please we will wait for this video and with Lidar sensor.

  • @guilhermeqg0
    @guilhermeqg0 3 роки тому

    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?

    • @KajalGada
      @KajalGada  3 роки тому

      Yes it is. Use the other distance sensors to detect objects near robot and avoid them as well.
      Does require code modification.

  • @ramazankarsanba805
    @ramazankarsanba805 2 роки тому

    My robot doesn't move but code is working. Can u help please ?

    • @KajalGada
      @KajalGada  2 роки тому

      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.

  • @mateusseixas9927
    @mateusseixas9927 3 роки тому

    nice

    • @KajalGada
      @KajalGada  3 роки тому

      Thank you, glad it helped you out. :)

  • @Sarah-ik8tt
    @Sarah-ik8tt 2 роки тому

    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 ? 💖

    • @KajalGada
      @KajalGada  2 роки тому

      Hi Sarah,
      Sorry for the late reply. What version of webots are you using?

    • @alexandrucristian7101
      @alexandrucristian7101 2 роки тому

      @@KajalGada i have the same problem on R2022a

    • @Sarah-ik8tt
      @Sarah-ik8tt 2 роки тому

      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)

  • @christinairene1932
    @christinairene1932 3 роки тому

    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?

    • @KajalGada
      @KajalGada  3 роки тому

      To add more robots follow the same process.
      For communication amongst the robots, considering using ROS with Webots

    • @christinairene1932
      @christinairene1932 3 роки тому

      @@KajalGada alrightt. Thanks for the replyy 😁

    • @christinairene1932
      @christinairene1932 3 роки тому

      @@KajalGada how do we apply this webots simulation to real robot?

    • @KajalGada
      @KajalGada  3 роки тому

      @@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.

  • @caspian19995
    @caspian19995 7 місяців тому

    can someone send me the code i dont know why i all the time make mistakes .If it is possible pleas send

  • @jywilson99
    @jywilson99 3 роки тому

    Do you have a Patreon account yet? I would like to support your excellent videos.

    • @KajalGada
      @KajalGada  3 роки тому +1

      Thank you for the kind words. At the moment, I don't have a Pateron account. Maybe something in the future. :)

  • @srividyagadi7835
    @srividyagadi7835 2 роки тому

    It is showing the following error:
    AttributeError: 'NoneType' object has no attribute 'setPosition'

    • @KajalGada
      @KajalGada  2 роки тому

      Make sure your robot motor name is same in scene tree & code.

    • @Sarah-ik8tt
      @Sarah-ik8tt 2 роки тому

      hello, what does same in scene tree and code mean?

  • @remaanmechatronics7092
    @remaanmechatronics7092 3 роки тому

    how do I create a communication between robots like khepera to cooperate and complete the task.

    • @KajalGada
      @KajalGada  3 роки тому

      Could you expand and provide more details?

    • @remaanmechatronics7092
      @remaanmechatronics7092 3 роки тому

      @@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?

    • @KajalGada
      @KajalGada  3 роки тому

      @@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. 👍🏻

    • @remaanmechatronics7092
      @remaanmechatronics7092 3 роки тому

      @@KajalGada No, no the robot name is khepera 3 . and let me try ROS. by the way thank you for helping. God bless you.

    • @KajalGada
      @KajalGada  3 роки тому

      @@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.

  • @71_a_siddharthjadhav70
    @71_a_siddharthjadhav70 2 роки тому

    How to setup motors configuration for epuck?

    • @KajalGada
      @KajalGada  2 роки тому

      what do you mean? The motors are already configured & can be used as is

    • @71_a_siddharthjadhav70
      @71_a_siddharthjadhav70 2 роки тому

      @@KajalGada so there is not need to separately configure the epuck motor, right?

    • @KajalGada
      @KajalGada  2 роки тому +1

      @@71_a_siddharthjadhav70 yeah

  • @ajoshi2663
    @ajoshi2663 3 роки тому

    Hello, in code it gives attribute error at setPosituon function...

    • @KajalGada
      @KajalGada  3 роки тому

      Hi Akshay,
      can you share the code you wrote?

    • @ajoshi2663
      @ajoshi2663 3 роки тому

      @@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)

    • @KajalGada
      @KajalGada  3 роки тому

      @@ajoshi2663 Your motor namers are incorrect.
      left_motor = robot.getMotor('left wheel motor')
      right_motor = robot.getMotor('right wheel motor')

    • @ajoshi2663
      @ajoshi2663 3 роки тому +1

      Ok I will change and try one more time..Thanks

    • @KajalGada
      @KajalGada  3 роки тому

      @@ajoshi2663 Let me know if that works.

  • @narendravotla6428
    @narendravotla6428 3 роки тому

    Hi ,where can I get the code?

    • @KajalGada
      @KajalGada  3 роки тому

      It is explained in the video

  • @shreyanand2226
    @shreyanand2226 3 роки тому

    Can u give full code

    • @KajalGada
      @KajalGada  3 роки тому +1

      It is in the video.

    • @shreyanand2226
      @shreyanand2226 3 роки тому

      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

    • @KajalGada
      @KajalGada  3 роки тому

      ​@@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. :)

  • @vekariyabhavtik127
    @vekariyabhavtik127 3 роки тому

    Wall following robot history

    • @KajalGada
      @KajalGada  3 роки тому

      Not sure what you mean

  • @jeffe124
    @jeffe124 3 роки тому

    po mc

  • @hananabd8517
    @hananabd8517 3 роки тому

    Hi, what's the controller code if we add Lidar and enable the camera to the robot?

    • @KajalGada
      @KajalGada  2 роки тому +1

      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