How to Write PoMoCo 2.0 Moves


-currently expanding-

PoMoCo moves are python ‘.py’ files located in PoMoCo’s Robot’s Move folder.  You can create new move file, and when you load PoMoCo, they will show up as new buttons to be pressed. Pressing these buttons will run the move file, and generate the proper serial commands that will be sent to your Hexy’s Servotor32 controller.

Here’s some basic commands to write move files:

Run another existing move

Run another move by writing its name inside a ‘move’ funciton. This move’s file is MoveName.py, but here we can execute it as such:


Pausing

Here’s how to pass time. Import the time library in order to wait wait for one second:


Moving Hexy’s joints:

The legs are written in short code:

Each leg has three parts: hip, knee and ankle. For example, for the left front foot, you would access each of these legs via:
You can change the degrees of each joint like so: hexy.<leg>.<joint>(angle) Like:


Setting Foot Height

setFootY attempts to use inverse kinematics to set both the knee and the ankle joint to a certain level, such that the foot is vertical to the ground. You can have it set the foot flat to a certain level: 60 is considered the common ‘floor’. 0 for this command is flat-even with the body (although hexy can’t position the foot vertically at that height).

Replanting the Leg

You can have hexy reposition a foot to a new hip angle while simultaneously lifting and planting the leg:


Set of Legs

You can also access all legs via:
You can loop over these legs by going:
You can do the same with the two ‘tripods’ of hexy,  for example: