Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- TIME_STEP = 64;
- % get and enable devices, e.g.:
- % camera = wb_robot_get_device('camera');
- % wb_camera_enable(camera, TIME_STEP);
- motor1 = wb_robot_get_device( 'left wheel motor' );
- motor2 = wb_robot_get_device( 'right wheel motor' );
- wb_motor_set_position( motor1, inf );
- wb_motor_set_position( motor2, inf );
- while wb_robot_step(TIME_STEP) ~= -1
- v = 0;
- w = 1;
- v1 = 0.4878*v + 1.2683*w;
- v2 = 0.4878*v - 1.2683*w;
- wb_motor_set_velocity( motor1, v1 )
- wb_motor_set_velocity( motor2, v2 )
- % read the sensors, e.g.:
- % rgb = wb_camera_get_image(camera);
- drawnow;
- wb_console_print( 'abcd', WB_STDOUT );
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement