Behaviors

Behaviors are multi-frame, one-shot actions: the robot performs the action once and then returns to a neutral state. They are great for demos and interaction.

Use case: say hello and show off

using PetoiBittle

connection = PetoiBittle.connect(PetoiBittle.find_bittle_port())

PetoiBittle.greet(connection)        # wave hello
sleep(3)
PetoiBittle.check_around(connection) # look around
sleep(3)
PetoiBittle.back_flip(connection)    # the grand finale

PetoiBittle.disconnect(connection)
Warning

Dynamic behaviors such as PetoiBittle.back_flip and PetoiBittle.push_up are physically demanding. Run them on a clear, flat surface with the robot well charged.

Reference

PetoiBittle.greet — Function
greet(connection)

Make the robot greet with a friendly gesture (category: Behaviors).

Convenience wrapper, equivalent to send_command(connection, Greeting()).

source
PetoiBittle.check_around — Function
check_around(connection)

Make the robot look around to check the surroundings (category: Behaviors).

Convenience wrapper, equivalent to send_command(connection, CheckAround()).

source
PetoiBittle.push_up — Function
push_up(connection)

Make the robot do push-ups (category: Behaviors).

Convenience wrapper, equivalent to send_command(connection, PushUp()).

source
PetoiBittle.pee — Function
pee(connection)

Make the robot lift a leg to pee (category: Behaviors).

Convenience wrapper, equivalent to send_command(connection, Pee()).

source
PetoiBittle.play_dead — Function
play_dead(connection)

Make the robot play dead (mimic death) (category: Behaviors).

Convenience wrapper, equivalent to send_command(connection, MimicDeath()).

source
PetoiBittle.back_flip — Function
back_flip(connection)

Make the robot perform a backflip (category: Behaviors).

Convenience wrapper, equivalent to send_command(connection, BackFlip()).

source