![]() # initialize motor speeds at 50% of MAX_SPEED. ![]() Left_obstacle = psValues > 80.0 or psValues > 80.0 or psValues > 80.0 Right_obstacle = psValues > 80.0 or psValues > 80.0 or psValues > 80.0 # - perform simulation steps until Webots is stopping the controller RightMotor = robot.getMotor('right wheel motor') LeftMotor = robot.getMotor('left wheel motor') Gs.append(robot.getDistanceSensor(gsNames)) Ps.append(robot.getDistanceSensor(psNames)) # counter: used to maintain an active state for a number of cycles Timestep = int(robot.getBasicTimeStep()) # # get the time step of the current world. My code: """line_following_behavior controller."""įrom controller import Robot, DistanceSensor, Motor Please don't send me to see the tutorials, since I already followed them. I've seen some codes written in C but I'm not familiar with C programming language. When I remove either line following part of code or obstacle avoidance part the appropriate result is working but simultaneously they don't functioning. So I'm trying to reproduce the same behaviour but when the robot aproaches to an obstacle it stucks and doesn't try to avoid it. Compass WorldInfonorthDirection from controller import Robot from controller import Compass robot Robot() timeStep getBasicTimeStep() Compass robot.getCompass('Compassname') Compass.enable(timeStep) Compass.disable() Compass. I have been looking at the nodes available in Webots, but apart from GPS node (which is not available in Aibo) I couldn't find anything relevant. The robot should go forwards following the line until an obstacle is detected by the front distance sensors, and then to turn towards the obstacle-free direction and then get back to the line. The movement is performed by setting new joint position, and currently it results in jerky random movements. The robot program was written in Python and the simulation is running on Webots. A few VRML nodes have been extended to include more elds, like the WorldInfoand the Spherenode. This informa-tion can be also found for each node in the Webots resources/nodesdirectory. So I'm trying to program a very simple collision avoidance behavior by following the line using ground and distance sensors of E-puck robot. Webots Nodes The nodes listed here are described using the standard VRML description syntax.
0 Comments
Leave a Reply. |