Library and utilities for operating legged robots