Application Programming Interface

The following predicates represent the actions that can be executed by a Golog interpreter:

 

querySensors(sensors, values, t)

This action unifies values with a list that contains the values, obtained at time t, from all the sensors whose names are mentioned in the list sensors, which can contain any number of sensors (Up to the total number of available sensors on the robot. Please refer to Appendix B for the list of sensor and joint names). For example:

querySensor([neckTilt1, neckPan, neckTilt2], V, 0)

will unify the variable V with a list of 3 double numbers corresponds to the value of the robot’s Tilt, Pan and Nod joints, respectively.

This is a blocking action.

 

queryBall(color, visible, xcoord, ycoord, area, t)

This action checks to see if the ball of color color , where color can be one of the terms {pink, orange, yellow, green}, is visible within the robot camera image at time t. If yes, it unifies visible with the number 1, xcoord and ycoord with the coordinate of the ball’s center within the image, and area with the area of the ball within the image. Otherwise, it unifies visible with the number 0. For example:

queryBall(pink, Vis, X, Y, Area, 0)

will tell whether the pink ball is visible in the robot’s camera at time 0, as well as its area and center’s location.

This is a blocking call.

 

searchBall(color, found, t)

This action causes the robot’s head to scan around, starting from time t, searching for the ball of color color. If it finds the ball, the action will leave the robot’s head pointing directly toward the ball’s center, and unifies found with the number 1. Otherwise, it leaves the robot head at an arbitrary position and unifies found with the number 0.

This is a blocking call.

 

moveJoints(jointCmdList, t)

This action moves, starting from time t, all the joints whose names are mentioned in the joint commands that are in the jointCmdList, which can contain any number of joint commands (up to the number of available joints on the robots). For example:

moveJoints([[lflJoint1, 10], [rflJoint1, 10]], 0)

contains two joint commands (two sub-lists inside the big list), and will concurrently move both the left and right front rotators 10 degrees.

This is a non blocking call.

 

motion(motionFile, t)

This action starts the motion defined in motionFile at time t, where motionFile is a standard Tekkotsu motion sequence descriptor file (see Tekkotsu tutorial for more details about motion sequences),. For example:

motion(“getrdy.mot”, 0)

will cause the robot to perform the motion defined by the file “getrdy.mot” at time 0.

This is a non-blocking call.

 

walk(x, y, y)

This action causes the robot to walk, at time t, x mm forward (backward if negative) and y mm to the left (right if negative). For example:

walk(500, 100, 0)

will causes the robot to walk, starting from time 0, 500 mm in the forward direction and 100 mm in the side direction. Note that this action simply “translate” (i.e., it preserves the robot’s body orientation) along the (500, 100) vector instead of causing it to turn and walk toward the direction of that vector. Likewise, the action

walk(0, 500, 0)

will cause the robot to do side-walking 500 to the left. To make the robot to turn its body, use the turn() action described below.

Because this action is implemented using Tekkotsu’s walk engine, it is possible to change the robot walking gait. Please refer to Tekkotsu’s Walk Calibration tutorial for instruction on how to do this.

This is a non-blocking call.

 

startWalk(x, y, t)

This action causes the robot to start walking, indefinitely, in the direction given by the vector  = (x, y).

This is a non-blocking call.

 

endWalk(t)

This action causes the robot to stop walking at time t (if it is walking at that time), regardless of whether it was started by walk() or startWalk().

This is a non-blocking call.

 

turn(a, t)

This action causes the robot to turn an angle a, around the z-axis (vertical axis), at time t. For example:

turn(50, 0)

will cause the robot to turn, by jogging in place, it body 50 degrees to the left starting at time 0.

This is a non-blocking call.

  

startTurn(a, t)

Similar to startWalk().

 

endTurn(t)

Similar to endWalk(t)