Skip to content

Instantly share code, notes, and snippets.

View acidzebra's full-sized avatar

acidzebra acidzebra

View GitHub Profile
#!/usr/bin/env python3
# Copyright (c) 2016 Anki, Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License in the file LICENSE.txt or at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
@acidzebra
acidzebra / cozmo_unleashed.py
Last active January 25, 2022 14:23
Cozmo Unleashed: Attempting to create a perpetuum cozmobile for Anki's awesome robot - https://www.anki.com/en-us/cozmo
#!/usr/bin/env python3
#
# NOTE I HAVE MOVED ON TO USING A CUSTOM MARKER PRINTED OUT AND PASTED ON TOP OF MY CHARGER
# SIZED AT 4CM/SIDE COZMO HAS A MUCH BETTER CHANCE OF FINDING THE CHARGER - SIMILAR TO THE NEW VECTOR ROBOT
# the last "general purpose" version is https://gist.github.com/acidzebra/c02ff8c8ccb0e3a057ae0b48a5082a68/ad4ff9d686f7e2a1b197c4a26c6290d51a7c4380
# if you want to print out your own you can find a version of marker CustomObjectMarkers.Hexagons2 used here
# http://cozmosdk.anki.com/docs/generated/cozmo.objects.html?highlight=hexagons2#cozmo.objects.CustomObjectMarkers.Hexagons2
#
# WHAT THIS PROGRAM DOES
#
@acidzebra
acidzebra / cozmo_unleashed_scheduler.py
Last active November 13, 2020 03:10
Autonomy for Cozmo, a script for having Cozmo freeplay until the battery runs low and then find/dock with the charger, with crude scheduler for weekdays/weekend and allowed play times. While in "allowed" play times, Cozmo has a 20% every 5 minutes of waking up and playing. Will attempt to find dock and charge when battery runs low.
#!/usr/bin/env python3
# based on Copyright (c) 2016 Anki, Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License in the file LICENSE.txt or at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
@acidzebra
acidzebra / cozmo_unleashed-devel.py
Last active December 30, 2017 18:09
dev version of the cozmo_unleashed script. Rough edges ahead.
#!/usr/bin/env python3
# based on Copyright (c) 2016 Anki, Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License in the file LICENSE.txt or at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
from Cozmo import *
triggerActions = {"AcknowledgeFaceInitPause" : cozmo.anim.Triggers.AcknowledgeFaceInitPause,
"AcknowledgeFaceNamed" : cozmo.anim.Triggers.AcknowledgeFaceNamed,
"AcknowledgeFaceUnnamed" : cozmo.anim.Triggers.AcknowledgeFaceUnnamed,
"AcknowledgeObject" : cozmo.anim.Triggers.AcknowledgeObject,
"AskToBeRightedLeft" : cozmo.anim.Triggers.AskToBeRightedLeft,
"AskToBeRightedRight" : cozmo.anim.Triggers.AskToBeRightedRight,
"BlockReact" : cozmo.anim.Triggers.BlockReact,
"BuildPyramidReactToBase" : cozmo.anim.Triggers.BuildPyramidReactToBase,
#!/usr/bin/env python3
# based on Copyright (c) 2016 Anki, Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License in the file LICENSE.txt or at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
#!/usr/bin/env python3
# based on Copyright (c) 2016 Anki, Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License in the file LICENSE.txt or at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
import cozmo
import time
def cozmo_odetojoy(robot: cozmo.robot.Robot):
notes = [
cozmo.song.SongNote(cozmo.song.NoteTypes.E2, cozmo.song.NoteDurations.Quarter),
cozmo.song.SongNote(cozmo.song.NoteTypes.E2, cozmo.song.NoteDurations.Quarter),
cozmo.song.SongNote(cozmo.song.NoteTypes.F2, cozmo.song.NoteDurations.Quarter),
cozmo.song.SongNote(cozmo.song.NoteTypes.G2, cozmo.song.NoteDurations.Quarter),
cozmo.song.SongNote(cozmo.song.NoteTypes.G2, cozmo.song.NoteDurations.Quarter),
cozmo.song.SongNote(cozmo.song.NoteTypes.F2, cozmo.song.NoteDurations.Quarter),
@acidzebra
acidzebra / vector_hue_sensors.py
Last active July 5, 2022 22:45
a script intended to run 24/7 in the background, it will send Vector off of the charger if the Hue sensor detects a presence in the room, but only if the current time is between PLAYTIME_EARLIEST and PLAYTIME_LATEST. This is for use with the Anki Vector robot which is an awesome little bundle of joy with a full-fledged Python SDK and a ton of sm…
#!/usr/bin/env python3
# Copyright (c) 2019 acidzebra
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# https://www.apache.org/licenses/LICENSE-2.0
#
#!/usr/bin/env python3
# Copyright (c) 2019 acidzebra
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# https://www.apache.org/licenses/LICENSE-2.0
#