CAUTION! 

It is up to the user to take extreme care in making sure that custom scripts running on your T8X spider robot are carefully written to execute “safe” moves.  Just as with some industrial robots and CNC machines, if an unintended command is sent to it, it is possible for the robot or machine to damage itself.  The most common way this can occur is when a servo motor is instructed to move past an angle that it physically cannot reach.  For example, the T8X spider robot cannot scratch its own back because the configuration of the legs physically does not allow it, but when commanded to do so, it will blindly try it anyway, twisting its leg joints in unnatural ways and potentially stressing or damaging the servo motors in the process. 

In programming mode, all safety limits are turned off.  The robot will follow instructions exactly as commanded, so if you’re writing and running your own scripts or if you’re running scripts written by a third party, do so at your own risk.  We recommended that you always check and double check your code before running it.

From time to time, we will be posting scripts on our website which have been verified and tested by us to be “safe” so that any user, with or without programming experience can download and run.

 

TUTORIAL CONTENTS
In this second tutorial, we’ll focus on walk commands by covering the following topics:

  • Walk forward / backward
  • Walk turning left / right
  • Crab left / right

If you have not gone through the first tutorial, we recommend that you go through it first before beginning this second tutorial.

Important!
Since the T8X will be walking around in this tutorial, we recommend that you place the robot on the floor instead of on top of a table where it can fall off the edge.

WALK FORWARD / BACKWARD
The command to walk forward and backward is:

t8x.cmd(“walkY < speed >”);

where:

< speed > is the speed in millimeters per second. Range is [0 to 200] with stop (speed = 0) at 100.
Walk forward is done using numbers between 101 and 200 while walk backward is done using numbers between 0 and 99.

Copy and paste the following code into one of the “sequenceXX.lua” slots available in the Custom Scripts section of the user interface.

Example 2.1:

function setup()

t8x.cmd("walkY 150"); -- walk forward at 50mm/s
t8x.delay(5000); -- wait 5000 milliseconds
t8x.cmd("walkY 100"); -- stop walking forward or backward
t8x.delay(5000);
t8x.cmd("walkY 50"); -- walk backward at 50mm/s
t8x.delay(5000);
t8x.cmd("walkY 100"); -- stop walking forward or backward
t8x.delay(5000);

end
function loop()
end

t8x.delay() instructs the program to wait a certain amount of time in milliseconds before moving on to the next line of code. Here, t8x.delay(5000) means to wait 5000 milliseconds (5 seconds) before moving on to the next command.
With this example, the T8X should walk forward for 5 seconds, stop for 5 seconds, walk backward for 5 seconds, and stop for 5 seconds.
In Lua, the double dash “--” is used to indicate comments. Anything typed on the right side of “--” will not be executed.

WALK TURNING LEFT / RIGHT
The command for walking while turning is:

t8x.cmd("walkTurnZ < angularSpeed >");

where:

< angularSpeed > speed of rotation in degrees per second. Range is [0 to 200] with stop (speed = 0) at 100.
Walking while turning left is done using numbers between 101 and 200. Walk while turning right is done using numbers between 0 and 99.

The next example demos walking while turning left or right.

Example 2.2:

function setup()

t8x.cmd("walkTurnZ 125"); -- walk turn left at 25 deg/s
t8x.delay(5000); -- wait 5000 milliseconds
t8x.cmd("walkTurnZ 100"); -- stop walk turn
t8x.delay(5000);
t8x.cmd("walkTurnZ 75"); -- walk turn right at 25 deg/s
t8x.delay(5000);
t8x.cmd("walkTurnZ 100"); -- stop walk turn
t8x.delay(5000);

end
function loop()
end

CRAB WALK LEFT / RIGHT
The command for crab walk is:

t8x.cmd(“walkX < speed >”);

where:

< speed > is the speed in millimeters per second. Range is [0 to 200] with stop (speed = 0) at 100.
Walking left is done using numbers between 0 and 99 while walking right is done using numbers between 101 and 200.

Example 2.3:

function setup()

t8x.cmd("walkX 150"); -- walk right at 50mm/s
t8x.delay(5000); -- wait 5000 milliseconds
t8x.cmd("walkX 100"); -- stop walking left or right
t8x.delay(5000);
t8x.cmd("walkX 50"); -- walk left at 50mm/s
t8x.delay(5000);
t8x.cmd("walkX 100"); -- stop walking left or right
t8x.delay(5000);

end
function loop()
end

 

This concludes the second tutorial for the T8X spider robot.  If you’re having trouble getting the code to work on your T8X, do not hesitate to contact us at support@robugtix.com.

If you have feedback, suggestions, want to report an error, or have an interesting script you would like to share with us, please email us at feedback@robugtix.com

This page may be updated or further expanded in the future based on feedback from users.