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)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.Greeting — Type
Greeting()A PetoiBittle.Command (category: Behaviors) that makes the robot greet with a friendly gesture.
Serializes to the firmware token "khi". Send it explicitly with PetoiBittle.send_command, or use the convenience verb PetoiBittle.greet.
PetoiBittle.greet — Function
greet(connection)Make the robot greet with a friendly gesture (category: Behaviors).
Convenience wrapper, equivalent to send_command(connection, Greeting()).
PetoiBittle.CheckAround — Type
CheckAround()A PetoiBittle.Command (category: Behaviors) that makes the robot look around to check the surroundings.
Serializes to the firmware token "kck". Send it explicitly with PetoiBittle.send_command, or use the convenience verb PetoiBittle.check_around.
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()).
PetoiBittle.PushUp — Type
PushUp()A PetoiBittle.Command (category: Behaviors) that makes the robot do push-ups.
Serializes to the firmware token "kpu". Send it explicitly with PetoiBittle.send_command, or use the convenience verb PetoiBittle.push_up.
PetoiBittle.push_up — Function
push_up(connection)Make the robot do push-ups (category: Behaviors).
Convenience wrapper, equivalent to send_command(connection, PushUp()).
PetoiBittle.Pee — Type
Pee()A PetoiBittle.Command (category: Behaviors) that makes the robot lift a leg to pee.
Serializes to the firmware token "kpee". Send it explicitly with PetoiBittle.send_command, or use the convenience verb PetoiBittle.pee.
PetoiBittle.pee — Function
pee(connection)Make the robot lift a leg to pee (category: Behaviors).
Convenience wrapper, equivalent to send_command(connection, Pee()).
PetoiBittle.MimicDeath — Type
MimicDeath()A PetoiBittle.Command (category: Behaviors) that makes the robot play dead (mimic death).
Serializes to the firmware token "kpd". Send it explicitly with PetoiBittle.send_command, or use the convenience verb PetoiBittle.play_dead.
PetoiBittle.play_dead — Function
play_dead(connection)Make the robot play dead (mimic death) (category: Behaviors).
Convenience wrapper, equivalent to send_command(connection, MimicDeath()).
PetoiBittle.BackFlip — Type
BackFlip()A PetoiBittle.Command (category: Behaviors) that makes the robot perform a backflip.
Serializes to the firmware token "kbf". Send it explicitly with PetoiBittle.send_command, or use the convenience verb PetoiBittle.back_flip.
PetoiBittle.back_flip — Function
back_flip(connection)Make the robot perform a backflip (category: Behaviors).
Convenience wrapper, equivalent to send_command(connection, BackFlip()).