RoboMaster S1 movement capabilities. - HU-ICT-LAB/RobotWars GitHub Wiki
Which actions can the RoboMaster perform in terms of movement?
Driving directions
The RoboMaster has omni-wheels instead of normal wheels as stated in: S1 Hardware Details. With these wheels de RoboMaster can drive in all directions in a 360 degree radius around himself. This means that the RoboMaster can drive not just Forward and backward, but also sideways or a combination where the RoboMaster goes Forward/Backward while at the same time sideways.
Gimbal limitations
The RoboMaster Blaster can turn around 540 degrees or 270 degrees in both directions when facing forward. With this the RoboMaster can aim in all directions without moving its chassis. Besides the ability to turn left or right, the RoboMasters Blaster also has the ability to move up and down. When facing forward, the Blaster can move 24 degrees down and 41 degrees up.
Code to perform the movement actions
The code that you can see here first moves the RoboMaster 0.5 meter forward, second it moves 0.5 meter to the right, third it turns 90 degrees and last. It returns to its starting position in one go instead of steps and recenters the gimbal if necessary.
from robomaster import robot
from time import sleep
if __name__ == '__main__':
ep_robot = robot.Robot()
ep_robot.initialize(conn_type="sta", sn="159CGAC0050QS0")
ep_chassis = ep_robot.chassis
ep_gimbal = ep_robot.gimbal
ep_blaster = ep_robot.blaster
sleep(3)
ep_chassis.move(x=0.5, y=0, z=0, xy_speed=1).wait_for_completed()
ep_chassis.move(x=0, y=0.5, z=0, xy_speed=1).wait_for_completed()
ep_chassis.move(x=0, y=0, z=90, xy_speed=1).wait_for_completed()
ep_chassis.move(x=0.5, y=-0.5, z=-90, xy_speed=1).wait_for_completed()
ep_gimbal.recenter().wait_for_completed()
ep_robot.close()
Sources:
Extra example sources
For other example codes to make the Robomaster Drive made by DJI. See the links below:
Official Chassis Action (half chinese) or Github Chassis Code examples
The links for the Gimbal movements are:
Official Gimbal Action (half chinese) or Github Gimbal Code examples
Info sources
- Introduction — RoboMaster Developer Guide documentation. (n.d.). RoboMaster Developer Guide. Retrieved October 15, 2021, from https://robomaster-dev.readthedocs.io/en/latest/introduction.html
- RoboMaster S1 - Specifications - DJI. (n.d.). DJI Official. Retrieved August 7, 2021, from https://www.dji.com/robomaster-s1/specs
Related issues
Issues: #6