<< return to Vizycam.com

User Tools

Site Tools


wiki:pet_companion2

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revision Previous revision
Next revision
Previous revision
wiki:pet_companion2 [2022/03/08 12:48]
vizycam
wiki:pet_companion2 [2022/07/12 14:35] (current)
vizycam
Line 4: Line 4:
  
  
-This tutorial will describe how to create your own Vizy application,​ accessible by browser either locally or remotely via the Internet. ​ After following this tutorial, you will be able to: +This tutorial will describe how to create your own Vizy application,​ accessible by browser either locally or remotely via the Internet.  ​If you just want to run the app, go [[wiki:​pet_companion2#​just-show-me-the-app|here]]. ​After following this tutorial, you will be able to: 
  
  
Line 261: Line 261:
 ===== Uploading pictures of your pet to the cloud ===== ===== Uploading pictures of your pet to the cloud =====
  
-Being able to see pictures of your pet throughout the day is good, you know, so you can make sure they'​re coping without your reassuring presence. ​ In order to do this you first need to set up [[wiki:google_cloud_setup|Google services]] if you haven'​t already.+Being able to see pictures of your pet throughout the day is good, you know, so you can make sure they'​re coping without your reassuring presence. ​ In order to do this you first need to set up [[wiki:google_cloud_setup3|Google services]] if you haven'​t already.
    
 <sxh python; highlight: [2, 4-6, 12-15, 21, 23-29, 42-44]; title: Take pictures of your pet and upload to the cloud:> <sxh python; highlight: [2, 4-6, 12-15, 21, 23-29, 42-44]; title: Take pictures of your pet and upload to the cloud:>
Line 326: Line 326:
 After following the [[wiki:​make_treat_dispenser|assembly and connection instructions]],​ you're ready to add a "​Dispense treat" button to your code. After following the [[wiki:​make_treat_dispenser|assembly and connection instructions]],​ you're ready to add a "​Dispense treat" button to your code.
  
-<sxh python; highlight: [5, 16, 21-22, 24-29]; title: Adding a treat dispenser button:>+<sxh python; highlight: [11, 16-1719-24]; title: Adding a treat dispenser button:>
 ... ...
-MEDIA_DIR = os.path.join(os.path.dirname(__file__),​ "​media"​) 
-PIC_TIMEOUT = 10 
-PIC_ALBUM = "Pet Companion"​ 
-TREAT_DISPENSER_BIT = 0 # I/O bit 0 
- 
 class PetCompanion:​ class PetCompanion:​
  
Line 359: Line 354:
 </​sxh> ​   ​ </​sxh> ​   ​
  
-This code is very similar to the **Call pet** code.  Lines 27-29 do the actual solenoid triggering. ​  +This code is very similar to the **Call pet** code.  Lines 22-24 do the actual solenoid triggering. ​  
  
  
Line 366: Line 361:
 The Pet Companion application wants to be accessible via the Internet, not just via your local network, so that when you're out and about you can see video of your little guy/gal and give him/her little rewards whenever you like.    ​ The Pet Companion application wants to be accessible via the Internet, not just via your local network, so that when you're out and about you can see video of your little guy/gal and give him/her little rewards whenever you like.    ​
  
-Vizy makes it easy to share your applications seamlessly on the Internet. ​ [[wiki:​remote|Web sharing]] requires some easy setup. ​ Setting up a custom domain can make it very straightforward for your friends/​family to access Pet Companion and check in on your pet.  You can give them the "Guest" ​account and password so they can't change things (e.g. network configuration,​ currently running app, etc.)  ​+Vizy makes it easy to share your applications seamlessly on the Internet. ​ [[wiki:​remote|Web sharing]] requires some easy setup. ​ Setting up a custom domain can make it very straightforward for your friends/​family to access Pet Companion and check in on your pet.  You can give them a [[wiki:​users|Guest account]] and password so they can't change things (e.g. network configuration,​ currently running app, etc.)  ​
  
 {{wiki:​share2.mp4|660x10|loop,​autoplay}} {{wiki:​share2.mp4|660x10|loop,​autoplay}}
Line 419: Line 414:
 {{wiki:​image_770.jpg?​500}} {{wiki:​image_770.jpg?​500}}
  
-There are other fields, such as ''​author'',​ ''​email'',​ ''​files'',​ and ''​image''​ that can provide more useful information about the application. ​ For an example of how these are used, check out [[https://​github.com/​charmedlabs/​vizy/​blob/​main/​apps/​motionscope/​info.json|info.json for MotionScope]]. ​+There are other fields, such as ''​author'',​ ''​email'',​ ''​files'',​ and ''​image''​ that can provide more useful information about the application. ​ For an example of how these are used, check out the [[https://​github.com/​charmedlabs/​vizy/​blob/​main/​apps/​motionscope/​info.json|info.json ​file for MotionScope]]. ​
    
 ==== Ball launcher ==== ==== Ball launcher ====
Line 429: Line 424:
 ==== Auto-treat ==== ==== Auto-treat ====
  
-Consider adding an "​auto-treat"​ option by using the treat dispenser and the TensorFlow detection of your pet.  For example, the auto-treat could be triggered when your pet sits in a particular place for an extended period of time, like his/her crate (put the treat dispenser where he/she can reach it within the crate), which could help with crate training. ​       +Consider adding an "​auto-treat"​ option by using the treat dispenser and the TensorFlow detection of your pet.  For example, the auto-treat could be triggered when your pet sits in a particular place for an extended period of time, like his/her crate (put the treat dispenser where he/she can reach it within the crate). This could help with crate training, for example      ​
  
  
Line 444: Line 439:
    
  
 +===== Just show me the app =====
  
-===== Wrapping ​up =====+You can find a more or less complete version of Pet Companion in the Vizy Examples -- that is, bring up the **Apps/​examples** dialog, choose **Examples** and browse to **Pet Companion**. ​ If you can't find Pet Companion in the Examples, make sure you're running version 0.1.98 or greater, and [[wiki:​update_vizy_software|update]] if necessary. ​
  
 +The source code can also be found [[https://​github.com/​charmedlabs/​vizy/​tree/​main/​examples/​pet_companion|here]].
 +
 +
 +===== Wrapping up =====
  
 You've just made an application with video streaming, deep learning, cloud communication,​ interactivity,​ IOT and robotics -- nice work!  Give yourself a pat on the back for being such a dedicated pet owner. ​ Your pet would totally give you a treat if he/she could!  ​ You've just made an application with video streaming, deep learning, cloud communication,​ interactivity,​ IOT and robotics -- nice work!  Give yourself a pat on the back for being such a dedicated pet owner. ​ Your pet would totally give you a treat if he/she could!  ​
  
wiki/pet_companion2.1646765304.txt.gz ยท Last modified: 2022/03/08 12:48 by vizycam