To develop a python control code to move the mobilerobot along the predefined path.
- RoboMaster EP core
- Python 3.7
Initiate the MobileRobot.
Connect your PC with the MobileRobot.
Open Python program.
Program the movements of the robot using python code.
Execute the python program.
from robomaster import robot
import time
if _name_ == '_main_':
ep_robot = robot.Robot()
ep_robot.initialize(conn_type="ap")
ep_chassis = ep_robot.chassis
ep_led = ep_robot.led
for i in range(10):
ep_led.set_led(comp="all",r=255,g=0,b=0,effect="on")
time.sleep(0.5)
ep_led.set_led(comp="all",r=0,g=255,b=0,effect="on")
time.sleep(0.5)
break
ep_chassis.move(x=0, y=-1.5, z=0, xy_speed=1).wait_for_completed()
ep_chassis.move(x=0, y=0, z=-30, xy_speed=1).wait_for_completed()
ep_chassis.move(x=3, y=0, z=0, xy_speed=1).wait_for_completed()
ep_chassis.move(x=0, y=0, z=-120, xy_speed=1).wait_for_completed()
ep_chassis.move(x=3, y=0, z=0, xy_speed=1).wait_for_completed()
ep_chassis.move(x=0, y=0, z=-30, xy_speed=1).wait_for_completed()
ep_chassis.move(x=0, y=1.5, z=0, xy_speed=1).wait_for_completed()
ep_chassis.move(x=0, y=0, z=180, xy_speed=1).wait_for_completed()
ep_chassis.move(x=0, y=-1.5, z=0, xy_speed=2).wait_for_completed()
ep_chassis.move(x=0, y=0, z=-30, xy_speed=2).wait_for_completed()
ep_chassis.move(x=3, y=0, z=0, xy_speed=2).wait_for_completed()
ep_chassis.move(x=0, y=0, z=-120, xy_speed=2).wait_for_completed()
ep_chassis.move(x=3, y=0, z=0, xy_speed=2).wait_for_completed()
ep_chassis.move(x=0, y=0, z=-30, xy_speed=2).wait_for_completed()
ep_chassis.move(x=0, y=1.5, z=0, xy_speed=2).wait_for_completed()
ep_chassis.move(x=0, y=0, z=180, xy_speed=2).wait_for_completed()
ep_robot.close()
ep_robot.close()
Insert image here
Upload your video in Youtube and paste your video-id here
Thus the python program code is developed to move the mobilerobot in the predefined path.
Mobile Robotics Laboratory
Department of Artificial Intelligence and Data Science/ Machine Learning
Saveetha Engineering College