Python

Python Commands

# motion


enableObstacleAvoidance(False|True) 

forward(m)

backward(m)

left(n)

right(n)


turn(deg, ref='REL'|'ABS', frame='odom'|'map'):

setSpeed(lx,az,tm,stopend=False)

setSpeed4W(fl,fr,bl,br,tm,stopend=False)

stop()


goto(gx,gy,gth)     # map pose (move_base)

gotoLabel(label)    # semantic map (map_server, move_base)

gotoTarget(gx,gy, frame='odom'|'map'|'gt')  # no path planning

p = getRobotPose(frame='odom'|'map'|'gt')  # p[0] : X, p[1] : Y, p[2] : theta

v = getSpeed()      # v[0]: linear x, v[1]: angular z


# range distance


d = obstacleDistance(dir_deg=0)



# audio


sound(name)

say(text, language='en')

s = asr()



# modim


show_image(value, which='default')

show_text(value, which='default')



# vision


img = getImage()

n = faceDetection(img)

(label,conf) = mobilenetObjrecClient(img[,server,port])

b = tagTrigger()  # boolean

id = tagID()      # id

d = tagDistance() # [m]

a = tagAngle()    # [deg]



# utils


wait(sec)     # Wait for X seconds

b = marrtinoOK() # returns 'true' if the robot is ready

d = distance(p1,p2) # Euclidean distance between points p1 and p2

display(x)     # Print the content of 'x' or the result of function 'x' in the Display area 



# simulator


stage_setpose(gx,gy,gth_deg)    # place the simulated robot in gx,gy,gth_deg