├── .gitattributes ├── .gitignore ├── .gitmodules ├── README.md ├── doc ├── bom.md ├── img │ ├── BOM │ │ ├── BOM_3D_printed_parts.jpg │ │ ├── BOM_Ollo.jpg │ │ ├── BOM_Robotis_XL320.jpg │ │ ├── BOM_electronics.jpg │ │ └── BOM_lamp.jpg │ ├── assembly │ │ ├── align-horn.jpg │ │ ├── ollo-tool.jpg │ │ ├── step-4-1.jpg │ │ ├── step-4-2.jpg │ │ ├── step-5.jpg │ │ ├── step-6.jpg │ │ ├── step-7.jpg │ │ ├── step-8.jpg │ │ ├── step-9.jpg │ │ ├── steps │ │ │ ├── ErgoJr_assembly.gif │ │ │ ├── step_0.jpg │ │ │ ├── step_1.jpg │ │ │ ├── step_10.jpg │ │ │ ├── step_11.jpg │ │ │ ├── step_12.jpg │ │ │ ├── step_13.jpg │ │ │ ├── step_14.jpg │ │ │ ├── step_15.jpg │ │ │ ├── step_16.jpg │ │ │ ├── step_17.jpg │ │ │ ├── step_18.jpg │ │ │ ├── step_19.jpg │ │ │ ├── step_2.jpg │ │ │ ├── step_20.jpg │ │ │ ├── step_21.jpg │ │ │ ├── step_22.jpg │ │ │ ├── step_23.jpg │ │ │ ├── step_24.jpg │ │ │ ├── step_25.jpg │ │ │ ├── step_26.jpg │ │ │ ├── step_3.jpg │ │ │ ├── step_4.jpg │ │ │ ├── step_5.jpg │ │ │ ├── step_6.jpg │ │ │ ├── step_7.jpg │ │ │ ├── step_8.jpg │ │ │ └── step_9.jpg │ │ └── unassembled_parts.jpg │ ├── electronic │ │ ├── power-board-xl320.png │ │ └── usb2dynamixel.jpg │ ├── ergo_jump.gif │ ├── ergo_tools.gif │ ├── motors.png │ ├── poppy_ergo_jr.jpg │ └── poppy_ergo_jr.png ├── roadmap.md └── suppliers.md ├── hardware ├── LICENSE.md ├── README.md ├── STEP │ ├── U_parts.step │ ├── base.step │ ├── lateral_parts.step │ └── tools │ │ ├── gripper.step │ │ ├── lamp.step │ │ └── pen_holder.step ├── STL │ ├── 4dofs-horn2horn.stl │ ├── 4dofs-side2side.stl │ ├── base.stl │ ├── disk_support.stl │ ├── horn2horn.stl │ ├── long_U.stl │ ├── short_U.stl │ ├── side2side.stl │ ├── support_camera.stl │ └── tools │ │ ├── gripper-fixation.stl │ │ ├── gripper-fixed_part.stl │ │ ├── gripper-rotative_part.stl │ │ ├── lamp.stl │ │ ├── pen-holder.stl │ │ └── pen-screw.stl └── laser_cutting │ ├── 4dof-parts.pdf │ └── disk_support.pdf └── software ├── LICENSE ├── MANIFEST.in ├── README ├── data ├── marker_112259237.png ├── marker_221052793.png └── marker_44616414.png ├── poppy_ergo_jr ├── __init__.py ├── _version.py ├── configuration │ └── poppy_ergo_jr.json ├── poppy_ergo_jr.py ├── poppy_ergo_jr.urdf ├── primitives │ ├── How_to_add_primitive_FR.py │ ├── __init__.py │ ├── dance.py │ ├── face_tracking.py │ ├── headfollow.py │ ├── jump.py │ ├── postures.py │ └── tracking_feedback.py └── vrep-scene │ ├── poppy_ergo_jr.ttt │ ├── poppy_ergo_jr_empty.ttt │ ├── poppy_ergo_jr_holder.ttt │ └── timer.lua ├── samples ├── handsoff_demo.py ├── img │ └── motors.png ├── marker_demo.py ├── notebooks │ ├── Discover your Poppy Ergo Jr.ipynb │ └── Record, Save and Play Moves on Poppy Ergo Jr.ipynb └── testbed.py └── setup.py /.gitattributes: -------------------------------------------------------------------------------- 1 | *.jpg filter=lfs diff=lfs merge=lfs -text 2 | *.png filter=lfs diff=lfs merge=lfs -text 3 | *.gif filter=lfs diff=lfs merge=lfs -text 4 | *.step filter=lfs diff=lfs merge=lfs -text 5 | *.stl filter=lfs diff=lfs merge=lfs -text 6 | *.pdf filter=lfs diff=lfs merge=lfs -text 7 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | # grizou 2 | hardware/parts/stl 3 | 4 | # Byte-compiled / optimized / DLL files 5 | __pycache__/ 6 | *.py[cod] 7 | *$py.class 8 | 9 | # C extensions 10 | *.so 11 | 12 | # Distribution / packaging 13 | .Python 14 | env/ 15 | build/ 16 | develop-eggs/ 17 | dist/ 18 | downloads/ 19 | eggs/ 20 | .eggs/ 21 | lib/ 22 | lib64/ 23 | parts/ 24 | sdist/ 25 | var/ 26 | *.egg 27 | *.egg-info 28 | 29 | # Sphinx 30 | doc/_build 31 | 32 | # OS generated files 33 | .DS_Store 34 | .DS_Store? 35 | .Trashes 36 | ehthumbs.db 37 | Thumbs.db 38 | 39 | # Gedit 40 | *~ 41 | 42 | # Jupyter (ipython) 43 | .ipynb_checkpoints/ 44 | *-checkpoint.ipynb 45 | 46 | # Pypot record files 47 | *.record 48 | 49 | -------------------------------------------------------------------------------- /.gitmodules: -------------------------------------------------------------------------------- 1 | [submodule "hardware/pixl_board"] 2 | path = hardware/pixl_board 3 | url = https://github.com/poppy-project/pixl.git 4 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # Poppy Ergo Jr 2 | 3 | [![PyPI](https://img.shields.io/pypi/v/poppy-ergo-jr.svg)](https://pypi.python.org/pypi/poppy-ergo-jr/) 4 | 5 | Poppy Ergo Jr robot is a small and low cost 6-degree-of-freedom robot arm. It consists of very simple shapes which can be easily 3D printed with FDM printers. 6 | 7 | It works with Dynamixel XL-320 motors, and a Raspberry Pi for control. 8 | 9 | ![jump](doc/img/ergo_jump.gif) 10 | 11 | It comes with three tools: 12 | * a lampshade 13 | * a grasper 14 | * a pen holder 15 | 16 | ![](doc/img/ergo_tools.gif) 17 | 18 | 19 | The Poppy Ergo Jr is ideal to start manipulating robots and learn robotic without difficulties. 20 | 21 | It is particularly well suited for educational purposes (cheap, simple to assemble, and easily controllable) or can be a very nice desk decoration for geeks and makers... 22 | 23 | Documentation about Poppy Ergo Jr as every projects of the Poppy platform is located at [docs.poppy-project.org](http://docs.poppy-project.org/en/). 24 | 25 | ## Build your own Poppy Ergo Jr 26 | 27 | * You can find the complete list of material needed on the **[Bill Of Material](doc/bom.md)**, and a [list of suppliers](doc/suppliers.md). 28 | ![](doc/img/assembly/steps/ErgoJr_assembly.gif) 29 | 30 | * Look at the [hardware folder](hardware) for the mechanical and electronics parts. 31 | 32 | * Then you can follow the assembly instructions presented [on the global poppy project documentation](http://docs.poppy-project.org/en/assembly-guides/ergo-jr/index.html) to guide you trough the process of transforming a bunch of parts in a magnificent robot ! 33 | 34 | * Once you have a ready-to-use Poppy Ergo Jr, you can take a look at [code samples](https://github.com/poppy-project/poppy-ergo-jr/tree/master/software/samples) for ideas 35 | 36 | ## Setup your Raspberry Pi board 37 | 38 | Poppy Ergo Jr is based on the [Raspberry Pi 2 board](https://www.raspberrypi.org/products/raspberry-pi-2-model-b/) but also works with [Raspberry Pi 3](https://www.raspberrypi.org/products/raspberry-pi-3-model-b/). We provide our own [image](https://github.com/poppy-project/poppy-ergo-jr/releases/download/1.0.0-gm/2017-02-21-poppy-ergo-jr.img.zip) (based on Raspbian) that can be directly copied to the SD-card. You can refer to the [documentation](http://docs.poppy-project.org/en/installation/burn-an-image-file.html) for more details. *Note that if you buy it as a kit from one of the reseller you will also get a pre-installed SD-card.* 39 | 40 | You can also use our setup script directly on a Raspberry Pi based on Raspbian. **Be aware tough that it takes some time and some good knowledge of Linux.** We use the [Raspoppy scripts](https://github.com/poppy-project/raspoppy) to setup the Raspberry Pi to match our needs (custom Python, setup serial communication, setup the web interface, a Poppy user...). 41 | 42 | It a two steps process: 43 | 44 | * Make sure you have enough space on the SD-card (at least 8GB). You can expand your partition if needed via: 45 | 46 | ```bash 47 | sudo raspi-config --expand-rootfs 48 | ``` 49 | 50 | You will need to reboot afterwards. 51 | 52 | * Run the installation commands: 53 | 54 | ```bash 55 | curl -L https://raw.githubusercontent.com/poppy-project/raspoppy/master/raspoppyfication.sh -o /tmp/raspoppyfication.sh 56 | chmod +x /tmp/raspoppyfication.sh 57 | sudo /tmp/raspoppyfication.sh 58 | ``` 59 | 60 | You can refer to the [documentation](http://docs.poppy-project.org/en/installation/install-a-poppy-board.html) for more details. 61 | 62 | ## Contributing 63 | 64 | You can share your experience, new design, ideas or questions on the [Poppy project forum](https://forum.poppy-project.org/). 65 | 66 | To contribute to this repository, you can [fork it](https://help.github.com/articles/fork-a-repo/) and propose a [pull request](https://help.github.com/articles/using-pull-requests/) *([Another useful link](https://gun.io/blog/how-to-github-fork-branch-and-pull-request/))* 67 | 68 | ## License 69 | 70 | All the technological development work made in the Poppy project is freely available under open source licenses. Only the name usage *"Poppy"* is restricted and protected as an international trademark, please contact us if you want to use it or have more information. 71 | 72 | | License | Hardware | Software | 73 | | ------------- | :-------------: | :-------------: | 74 | | Title | [Creative Commons BY-SA](http://creativecommons.org/licenses/by-sa/4.0/) |[GPL v3](http://www.gnu.org/licenses/gpl.html) | 75 | | Logo | [![Creative Commons BY-SA](https://i.creativecommons.org/l/by-sa/4.0/88x31.png) ](http://creativecommons.org/licenses/by-sa/4.0/) |[![GPL V3](https://www.gnu.org/graphics/gplv3-88x31.png)](http://www.gnu.org/licenses/gpl.html) | 76 | 77 | 78 | ## The Poppy project history 79 | 80 | The Poppy project was born in 2012 in the [Flowers laboratory](https://flowers.inria.fr/) at [Inria Bordeaux Sud-Ouest](http://www.inria.fr/en/centre/bordeaux). 81 | It was initiated during [Matthieu Lapeyre](https://github.com/matthieu-lapeyre)'s PhD Thesis surpervised by [Pierre Yves Oudeyer](http://www.pyoudeyer.com/). At the beginning, the development team was composed by [Matthieu Lapeyre](https://github.com/matthieu-lapeyre) (mechanics & design), [Pierre Rouanet](https://github.com/pierre-rouanet) (software) and [Jonathan Grizou](http://jgrizou.com/) (electronics). 82 | 83 | This project is initially a fundamental research project financed by [ERC Grant Explorer](http://erc.europa.eu/) to explore the role of embodiement and morphology properties on cognition and especially on the learning of sensori-motor tasks. 84 | 85 | 86 | ## More on the project 87 | 88 | - [Website](https://www.poppy-project.org) 89 | - [Forum](https://forum.poppy-project.org) 90 | - [Youtube](https://www.youtube.com/channel/UC3iVGSr-vMgnFlIfPBH2p7Q) 91 | - [Twitter](https://twitter.com/poppy_project) 92 | - [Facebook](https://www.facebook.com/poppycommunity/) 93 | - [Flickr](https://www.flickr.com/photos/poppy-project) 94 | - [Vimeo](https://vimeo.com/poppyproject) 95 | - [Thingiverse](http://www.thingiverse.com/poppy_project/) 96 | -------------------------------------------------------------------------------- /doc/bom.md: -------------------------------------------------------------------------------- 1 | # Bill of materials 2 | 3 | Here you will find the complete list of material (BOM) needed to build a Poppy Ergo Jr. 4 | 5 | ## Poppy's material 6 | - 1x [Pixl board](https://github.com/poppy-project/pixl) *(electronic board to control XL320 motors)* 7 | - 1x [disk_support.stl](https://github.com/poppy-project/poppy-ergo-jr/blob/master/hardware/STL/disk_support.stl) (using laser cutting) the 2D plan can be found [here](https://github.com/poppy-project/poppy-ergo-jr/tree/master/hardware/laser_cutting). *You can also 3D print the base but it will take a lot of time* 8 | - the 3D printed parts [STL here](https://github.com/poppy-project/poppy-ergo-jr/tree/master/hardware/STL) 9 | - 1x [base.stl](https://github.com/poppy-project/poppy-ergo-jr/blob/master/hardware/STL/base.stl) 10 | - 3x [horn2horn.stl](https://github.com/poppy-project/poppy-ergo-jr/blob/master/hardware/STL/horn2horn.stl) 11 | - 3x [side2side.stl](https://github.com/poppy-project/poppy-ergo-jr/blob/master/hardware/STL/side2side.stl) 12 | - 1x [long_U.stl](https://github.com/poppy-project/poppy-ergo-jr/blob/master/hardware/STL/long_U.stl) 13 | - 1x [short_U.stl](https://github.com/poppy-project/poppy-ergo-jr/blob/master/hardware/STL/short_U.stl) 14 | - 1x [support_camera.stl](https://github.com/poppy-project/poppy-ergo-jr/blob/master/hardware/STL/support_camera.stl) 15 | - the different tools 16 | - 1x [lamp.stl](https://github.com/poppy-project/poppy-ergo-jr/blob/master/hardware/STL/tools/lamp.stl) 17 | - 1x [gripper-fixation.stl](https://github.com/poppy-project/poppy-ergo-jr/blob/master/hardware/STL/tools/gripper-fixation.stl) 18 | - 1x [gripper-fixed_part.stl](https://github.com/poppy-project/poppy-ergo-jr/blob/master/hardware/STL/tools/gripper-fixed_part.stl) 19 | - 1x [gripper-rotative_part.stl](https://github.com/poppy-project/poppy-ergo-jr/blob/master/hardware/STL/tools/gripper-rotative_part.stl) 20 | - 1x [pen-holder.stl](https://github.com/poppy-project/poppy-ergo-jr/blob/master/hardware/STL/tools/pen-holder.stl) 21 | - 1x [pen-screw.stl](https://github.com/poppy-project/poppy-ergo-jr/blob/master/hardware/STL/tools/pen-screw.stl) 22 | 23 | ## Robotis parts 24 | - 6x Robotis dynamixel motors XL-320 25 | - 1x set of OLLO rivets (about 70 colored and 4 grey) 26 | - 1x OLLO TOOL 27 | 28 | ## Screw 29 | - 4x M2.5x6mm screw (for fixing the Raspberry Pi on the base) 30 | - 4x M2x5mm screw (for fixing the camera) 31 | - 4x M2 nuts (fixing camera) 32 | - 1x Standoff Male/Female M2.5 10mm 33 | 34 | ## Various electronics 35 | - 1x Raspberry Pi 2 or Raspberry Pi 3 36 | - 1x micro SD 8Go 37 | - 1x Rasperry Pi camera 38 | - 1x AC power 7.5V 2A with a 2.1 x 5.5 x 9.5 jack connector ([this one](http://fr.rs-online.com/web/p/alimentations-enfichables/7262814/?searchTerm=ECP-15-7.5E&relevancy-data=636F3D3226696E3D4931384E4B6E6F776E41734D504E266C753D6672266D6D3D6D61746368616C6C7061727469616C26706D3D5E5B5C707B4C7D5C707B4E647D2D2C2F255C2E5D2B2426706F3D313326736E3D592673743D4D414E5F504152545F4E554D4245522677633D424F5448267573743D4543502D31352D372E354526&sra=p) for instance). 39 | - Short ethernet cable 40 | -------------------------------------------------------------------------------- /doc/img/BOM/BOM_3D_printed_parts.jpg: -------------------------------------------------------------------------------- 1 | version https://git-lfs.github.com/spec/v1 2 | oid sha256:f71dc83beecc8f2c7076cdc2d6e01eaeafd46e3d63e7e933a0f51f68bf85f0a8 3 | size 464540 4 | -------------------------------------------------------------------------------- /doc/img/BOM/BOM_Ollo.jpg: -------------------------------------------------------------------------------- 1 | version https://git-lfs.github.com/spec/v1 2 | oid sha256:af226f0d6f4fcfbc4fae7e2db52702d4f8d64f2de092b7c08fe82ced0ebe4fdb 3 | size 443201 4 | -------------------------------------------------------------------------------- /doc/img/BOM/BOM_Robotis_XL320.jpg: -------------------------------------------------------------------------------- 1 | version https://git-lfs.github.com/spec/v1 2 | oid sha256:96419fc437604cfa8b01e61f3d1cdcbe46bc0cd7343052241e8721e211a11f9e 3 | size 471896 4 | -------------------------------------------------------------------------------- /doc/img/BOM/BOM_electronics.jpg: -------------------------------------------------------------------------------- 1 | version https://git-lfs.github.com/spec/v1 2 | oid sha256:9867440e62d9821dea70269584525dce992ca139eb2879b505515b02029c8bdc 3 | size 424248 4 | -------------------------------------------------------------------------------- /doc/img/BOM/BOM_lamp.jpg: -------------------------------------------------------------------------------- 1 | version https://git-lfs.github.com/spec/v1 2 | oid sha256:5426554ea523562f3e25651584846df0f49fcfe6e3356ac09be358428749b1bd 3 | size 463314 4 | -------------------------------------------------------------------------------- /doc/img/assembly/align-horn.jpg: -------------------------------------------------------------------------------- 1 | version https://git-lfs.github.com/spec/v1 2 | oid sha256:3b9ece1905e78116348bf55e9607cd493d0456e99af88d6801a7c338fb8d19db 3 | size 235454 4 | -------------------------------------------------------------------------------- /doc/img/assembly/ollo-tool.jpg: -------------------------------------------------------------------------------- 1 | version https://git-lfs.github.com/spec/v1 2 | oid sha256:b111d85c9eb04a9ee6bae3d676c0ce34551ac66453690419616d0d69444934da 3 | size 258036 4 | -------------------------------------------------------------------------------- /doc/img/assembly/step-4-1.jpg: -------------------------------------------------------------------------------- 1 | version https://git-lfs.github.com/spec/v1 2 | oid sha256:7595f95b0c1bdf7cc6f94d716dd01b40ef52a74fd24527c094675e7dd40486bc 3 | size 789869 4 | -------------------------------------------------------------------------------- /doc/img/assembly/step-4-2.jpg: -------------------------------------------------------------------------------- 1 | version https://git-lfs.github.com/spec/v1 2 | oid sha256:18fee0e5666c59acb17ec01de6cc870d3fc8f2cb4da075a2513a3b4079bf17f8 3 | size 463347 4 | -------------------------------------------------------------------------------- /doc/img/assembly/step-5.jpg: -------------------------------------------------------------------------------- 1 | version https://git-lfs.github.com/spec/v1 2 | oid sha256:320ab0d4d84633b26c30fd4d421cb4275ed68ad06c1f739761879361f932d601 3 | size 745373 4 | -------------------------------------------------------------------------------- /doc/img/assembly/step-6.jpg: -------------------------------------------------------------------------------- 1 | version https://git-lfs.github.com/spec/v1 2 | oid sha256:00d398962eaa923d4070ed12ba032fa85fe8fa4c42a917d7001c06abf502ef6f 3 | size 929466 4 | -------------------------------------------------------------------------------- /doc/img/assembly/step-7.jpg: -------------------------------------------------------------------------------- 1 | version https://git-lfs.github.com/spec/v1 2 | oid sha256:48d50fa99e867f54688b724fb6b372b17eb40e0907629f5da254abc17d6f6af2 3 | size 409753 4 | -------------------------------------------------------------------------------- /doc/img/assembly/step-8.jpg: -------------------------------------------------------------------------------- 1 | version https://git-lfs.github.com/spec/v1 2 | oid sha256:079469d1fd444c7c136605cf233c3fb8da9bfe499503b064ae4756ac816c2167 3 | size 716497 4 | -------------------------------------------------------------------------------- /doc/img/assembly/step-9.jpg: -------------------------------------------------------------------------------- 1 | version https://git-lfs.github.com/spec/v1 2 | oid sha256:e0556831dfc48e214de3335ec234686ffa4da644b7cf738800a64596ef7c07a6 3 | size 1159628 4 | -------------------------------------------------------------------------------- /doc/img/assembly/steps/ErgoJr_assembly.gif: -------------------------------------------------------------------------------- 1 | version https://git-lfs.github.com/spec/v1 2 | oid sha256:1f9aa97a7685a789acce738621dcb70b5ff88dca1570dc87a17574d46a354018 3 | size 5966758 4 | -------------------------------------------------------------------------------- /doc/img/assembly/steps/step_0.jpg: -------------------------------------------------------------------------------- 1 | version https://git-lfs.github.com/spec/v1 2 | oid sha256:abb740f062732711194e5db048ae94551a7edf6a569732dd4538d1e0ccb3aec2 3 | size 441182 4 | -------------------------------------------------------------------------------- /doc/img/assembly/steps/step_1.jpg: -------------------------------------------------------------------------------- 1 | version https://git-lfs.github.com/spec/v1 2 | oid sha256:d8daa2f84176c1e26fd62b41fbcc6d86d611a96dfddc02f3c2eb61af9e18c200 3 | size 428293 4 | -------------------------------------------------------------------------------- /doc/img/assembly/steps/step_10.jpg: -------------------------------------------------------------------------------- 1 | version https://git-lfs.github.com/spec/v1 2 | oid sha256:f862f970a9435059f8eeed997e6eb7cfb971b786bd59118e15c120ed46f8177b 3 | size 349624 4 | -------------------------------------------------------------------------------- /doc/img/assembly/steps/step_11.jpg: -------------------------------------------------------------------------------- 1 | version https://git-lfs.github.com/spec/v1 2 | oid sha256:b5545683f95805f4f68e1b50237b787f9be5a5a43d66eac318a8863700c9b321 3 | size 392412 4 | -------------------------------------------------------------------------------- /doc/img/assembly/steps/step_12.jpg: -------------------------------------------------------------------------------- 1 | version https://git-lfs.github.com/spec/v1 2 | oid sha256:46b11eb4a14c5eda69abbacebfdeca3738b1721a1548a8082dddeaa015a90837 3 | size 394976 4 | -------------------------------------------------------------------------------- /doc/img/assembly/steps/step_13.jpg: -------------------------------------------------------------------------------- 1 | version https://git-lfs.github.com/spec/v1 2 | oid sha256:5a7da69db431df892f700a34e65a77c325ea653b3cede1dedeed1b741f1b3e80 3 | size 389831 4 | -------------------------------------------------------------------------------- /doc/img/assembly/steps/step_14.jpg: -------------------------------------------------------------------------------- 1 | version https://git-lfs.github.com/spec/v1 2 | oid sha256:3dcf59cdaf782812477c17d56b0a7526a8fd549f9ef75d58450a5b678f0994a5 3 | size 401298 4 | -------------------------------------------------------------------------------- /doc/img/assembly/steps/step_15.jpg: -------------------------------------------------------------------------------- 1 | version https://git-lfs.github.com/spec/v1 2 | oid sha256:e3c1f18577e7f7863bcb4e61b32deeb57f7622bafc95d00d886be8944599bd8a 3 | size 396868 4 | -------------------------------------------------------------------------------- /doc/img/assembly/steps/step_16.jpg: -------------------------------------------------------------------------------- 1 | version https://git-lfs.github.com/spec/v1 2 | oid sha256:f60a35dee6f91858def364069d742288942a8a471e6608671508a0b544517d29 3 | size 392094 4 | -------------------------------------------------------------------------------- /doc/img/assembly/steps/step_17.jpg: -------------------------------------------------------------------------------- 1 | version https://git-lfs.github.com/spec/v1 2 | oid sha256:f4a00cf9394d1053afb9422119650283672cd497029fc4e041913b77dd3d2526 3 | size 397861 4 | -------------------------------------------------------------------------------- /doc/img/assembly/steps/step_18.jpg: -------------------------------------------------------------------------------- 1 | version https://git-lfs.github.com/spec/v1 2 | oid sha256:925d45da4c33506e63bb966bee074b42846e950866c4525f4477cac0a4871e5d 3 | size 400093 4 | -------------------------------------------------------------------------------- /doc/img/assembly/steps/step_19.jpg: -------------------------------------------------------------------------------- 1 | version https://git-lfs.github.com/spec/v1 2 | oid sha256:88d39576ddb2005b69afb588f962f5f74f48a7fcfc7a3e21dfe017c9ea386978 3 | size 390587 4 | -------------------------------------------------------------------------------- /doc/img/assembly/steps/step_2.jpg: -------------------------------------------------------------------------------- 1 | version https://git-lfs.github.com/spec/v1 2 | oid sha256:cbff4ffcd1b76d90fec0e1f532ed9350c92584ddaad3ece013adbc55ff18e9ff 3 | size 420946 4 | -------------------------------------------------------------------------------- /doc/img/assembly/steps/step_20.jpg: -------------------------------------------------------------------------------- 1 | version https://git-lfs.github.com/spec/v1 2 | oid sha256:cb7861358b411e0f1b2b0f191fc464f27be28c6d70413f76128f2f799cdb8df8 3 | size 381500 4 | -------------------------------------------------------------------------------- /doc/img/assembly/steps/step_21.jpg: -------------------------------------------------------------------------------- 1 | version https://git-lfs.github.com/spec/v1 2 | oid sha256:8d71964f81799f95579e806553c069c5c222dcabaccc67edfa4c08dd7f474f86 3 | size 401189 4 | -------------------------------------------------------------------------------- /doc/img/assembly/steps/step_22.jpg: -------------------------------------------------------------------------------- 1 | version https://git-lfs.github.com/spec/v1 2 | oid sha256:bd62fe1609abbb5fabe6daa76d4d96d1ad4b561bcdcb30c1a3d98a2830a6b260 3 | size 427266 4 | -------------------------------------------------------------------------------- /doc/img/assembly/steps/step_23.jpg: -------------------------------------------------------------------------------- 1 | version https://git-lfs.github.com/spec/v1 2 | oid sha256:7530984d58163d69e5fb936dffbc055a79c8cc595549ad6c04fb9cb10a9843d1 3 | size 409453 4 | -------------------------------------------------------------------------------- /doc/img/assembly/steps/step_24.jpg: -------------------------------------------------------------------------------- 1 | version https://git-lfs.github.com/spec/v1 2 | oid sha256:f09a7ba1f2db95064c86d3142f7c5df404326fdf855afa42955ccc61606e931b 3 | size 410367 4 | -------------------------------------------------------------------------------- /doc/img/assembly/steps/step_25.jpg: -------------------------------------------------------------------------------- 1 | version https://git-lfs.github.com/spec/v1 2 | oid sha256:50cd4222040436adeeb47732ecfa35bec9cc148a64be29ad10f32324609f9ec2 3 | size 410438 4 | -------------------------------------------------------------------------------- /doc/img/assembly/steps/step_26.jpg: -------------------------------------------------------------------------------- 1 | version https://git-lfs.github.com/spec/v1 2 | oid sha256:edf37da980c9b6902776fbc707c051858cf2e7860c3e24fb1ca50fcd77503e41 3 | size 393673 4 | -------------------------------------------------------------------------------- /doc/img/assembly/steps/step_3.jpg: -------------------------------------------------------------------------------- 1 | version https://git-lfs.github.com/spec/v1 2 | oid sha256:3c7efea0e0f1771e6d86f855e12cd08c79cd3b5d6398e4cb89d9cf6da15347c0 3 | size 406509 4 | -------------------------------------------------------------------------------- /doc/img/assembly/steps/step_4.jpg: -------------------------------------------------------------------------------- 1 | version https://git-lfs.github.com/spec/v1 2 | oid sha256:fd3a8b7afc0abfd7f88626ac7548a4618a71a65d82ba8a118e8d62421058968c 3 | size 411547 4 | -------------------------------------------------------------------------------- /doc/img/assembly/steps/step_5.jpg: -------------------------------------------------------------------------------- 1 | version https://git-lfs.github.com/spec/v1 2 | oid sha256:0672796be374c60b74620b05367b2de133594fa6d982d21ce99ba1fde88023d1 3 | size 425939 4 | -------------------------------------------------------------------------------- /doc/img/assembly/steps/step_6.jpg: -------------------------------------------------------------------------------- 1 | version https://git-lfs.github.com/spec/v1 2 | oid sha256:d37ebb30996cf2b7f70563bf054bbba30e3cedfcb5d36321e1ea31fc8894e04a 3 | size 402008 4 | -------------------------------------------------------------------------------- /doc/img/assembly/steps/step_7.jpg: -------------------------------------------------------------------------------- 1 | version https://git-lfs.github.com/spec/v1 2 | oid sha256:ef5f41efbe94591dffede5665959e70ed7d6c23a407b812d0167cc8d1f2adc47 3 | size 411053 4 | -------------------------------------------------------------------------------- /doc/img/assembly/steps/step_8.jpg: -------------------------------------------------------------------------------- 1 | version https://git-lfs.github.com/spec/v1 2 | oid sha256:09314ac5e28baae17053e3874e8e357662e2fed6da53b7a84aea0145110c3ebb 3 | size 408154 4 | -------------------------------------------------------------------------------- /doc/img/assembly/steps/step_9.jpg: -------------------------------------------------------------------------------- 1 | version https://git-lfs.github.com/spec/v1 2 | oid sha256:13d51a14c4d0c5115097faed17673859d02bdb961ff7948f0c204c5dc9fe9fb9 3 | size 397299 4 | -------------------------------------------------------------------------------- /doc/img/assembly/unassembled_parts.jpg: -------------------------------------------------------------------------------- 1 | version https://git-lfs.github.com/spec/v1 2 | oid sha256:4aeb75c81c7d5e13b69b3c46ef7e5ada7897276186a62ff43042f12945f41419 3 | size 368661 4 | -------------------------------------------------------------------------------- /doc/img/electronic/power-board-xl320.png: -------------------------------------------------------------------------------- 1 | version https://git-lfs.github.com/spec/v1 2 | oid sha256:a46c820b1ada04957b4c0fce7b4e0dd8bceb382b3b5240cb6f9059e992df8728 3 | size 141578 4 | -------------------------------------------------------------------------------- /doc/img/electronic/usb2dynamixel.jpg: -------------------------------------------------------------------------------- 1 | version https://git-lfs.github.com/spec/v1 2 | oid sha256:46855cef401586b01dcef04b647da0eab4a8ea78fd883387ed37295e74c19ff5 3 | size 145819 4 | -------------------------------------------------------------------------------- /doc/img/ergo_jump.gif: -------------------------------------------------------------------------------- 1 | version https://git-lfs.github.com/spec/v1 2 | oid sha256:6dcfd1b989d5433a395f1faee808f8560600500a0a08eaa92f4a356474f97e47 3 | size 6875107 4 | -------------------------------------------------------------------------------- /doc/img/ergo_tools.gif: -------------------------------------------------------------------------------- 1 | version https://git-lfs.github.com/spec/v1 2 | oid sha256:66215901806bdf369427fe6bc821f829d72c378f167a407d1f731e6f6d6ac06a 3 | size 635558 4 | -------------------------------------------------------------------------------- /doc/img/motors.png: -------------------------------------------------------------------------------- 1 | version https://git-lfs.github.com/spec/v1 2 | oid sha256:b7dde72c8f8034ae8d9d0cf3f12a605777a036c2d95cc84df4f83a360d9684f7 3 | size 302493 4 | -------------------------------------------------------------------------------- /doc/img/poppy_ergo_jr.jpg: -------------------------------------------------------------------------------- 1 | version https://git-lfs.github.com/spec/v1 2 | oid sha256:2a8e98b23a2f88a265c24c0b00ead2b69bc9bb9545d50dfe3a3d030fbf18f9ab 3 | size 1171417 4 | -------------------------------------------------------------------------------- /doc/img/poppy_ergo_jr.png: -------------------------------------------------------------------------------- 1 | version https://git-lfs.github.com/spec/v1 2 | oid sha256:28572c2b043568f8335f0efca5660a0e336e86e1dd8df24d76514652958fcdf3 3 | size 49354 4 | -------------------------------------------------------------------------------- /doc/roadmap.md: -------------------------------------------------------------------------------- 1 | # RoadMap 2 | 3 | The next milestones for this project 4 | 5 | ## Poppy Ergo Jr 6 | 7 | * [x] Have a first version quickly, even if ugly code (by January 5) 8 | * [ ] Use a descriptive language to build "any" robot shape: 9 | - URDF: 10 | - http://wiki.ros.org/urdf/Tutorials/Create%20your%20own%20urdf%20file 11 | - http://mymodelrobot.appspot.com/5629499534213120 12 | - Denavit-Hartenberg: 13 | - http://en.wikipedia.org/wiki/Denavit%E2%80%93Hartenberg_parameters 14 | - https://github.com/cdsousa/sympybotics 15 | * [x] Create a gripper 16 | * [x] Create a pen holder 17 | * [x] Create a base for thymio 18 | * [x] Raspberry Pi 2B base: 19 | -------------------------------------------------------------------------------- /doc/suppliers.md: -------------------------------------------------------------------------------- 1 | # List of suppliers 2 | 3 | ##complete kit 4 | 5 | Complete kits with or without 3d printed parts are available on [Generation Robot](http://www.generationrobots.com/en/328-poppy-ergo-jr-robot) 6 | 7 | ## 3D printed parts 8 | 9 | If you do not have a 3D printer you can use online service such as [3D Hubs](https://www.3dhubs.com/), [Sculpteo](http://www.sculpteo.com/), [i.materialise](https://i.materialise.com/), [shapeways](http://www.shapeways.com/), ... 10 | 11 | You can also directly order from us on [our 3D hubs](https://www.3dhubs.com/bordeaux/hubs/matthieu-rafiaa). 12 | 13 | ## Robotis 14 | 15 | - Ollo rivets: http://www.generationrobots.com/en/401870-ollo-rivet-set-ors-10.html?search_query=OLLO&results=11 16 | - XL320: http://www.generationrobots.com/en/401692-dynamixel-xl-320-servo-motor.html 17 | -------------------------------------------------------------------------------- /hardware/LICENSE.md: -------------------------------------------------------------------------------- 1 | ### Disclaimer 2 | Document forked from https://github.com/idleberg/Creative-Commons-4.0-Markdown 3 | 4 | # Creative Commons 5 | 6 | ## Attribution-ShareAlike 4.0 International 7 | 8 | Creative Commons Corporation (“Creative Commons”) is not a law firm and does not provide legal services or legal advice. Distribution of Creative Commons public licenses does not create a lawyer-client or other relationship. Creative Commons makes its licenses and related information available on an “as-is” basis. Creative Commons gives no warranties regarding its licenses, any material licensed under their terms and conditions, or any related information. Creative Commons disclaims all liability for damages resulting from their use to the fullest extent possible. 9 | 10 | ### Using Creative Commons Public Licenses 11 | 12 | Creative Commons public licenses provide a standard set of terms and conditions that creators and other rights holders may use to share original works of authorship and other material subject to copyright and certain other rights specified in the public license below. The following considerations are for informational purposes only, are not exhaustive, and do not form part of our licenses. 13 | 14 | * __Considerations for licensors:__ Our public licenses are intended for use by those authorized to give the public permission to use material in ways otherwise restricted by copyright and certain other rights. Our licenses are irrevocable. Licensors should read and understand the terms and conditions of the license they choose before applying it. Licensors should also secure all rights necessary before applying our licenses so that the public can reuse the material as expected. Licensors should clearly mark any material not subject to the license. This includes other CC-licensed material, or material used under an exception or limitation to copyright. [More considerations for licensors](http://wiki.creativecommons.org/Considerations_for_licensors_and_licensees#Considerations_for_licensors). 15 | 16 | * __Considerations for the public:__ By using one of our public licenses, a licensor grants the public permission to use the licensed material under specified terms and conditions. If the licensor’s permission is not necessary for any reason–for example, because of any applicable exception or limitation to copyright–then that use is not regulated by the license. Our licenses grant only permissions under copyright and certain other rights that a licensor has authority to grant. Use of the licensed material may still be restricted for other reasons, including because others have copyright or other rights in the material. A licensor may make special requests, such as asking that all changes be marked or described. Although not required by our licenses, you are encouraged to respect those requests where reasonable. [More considerations for the public](http://wiki.creativecommons.org/Considerations_for_licensors_and_licensees#Considerations_for_licensees). 17 | 18 | ## Creative Commons Attribution-ShareAlike 4.0 International Public License 19 | 20 | By exercising the Licensed Rights (defined below), You accept and agree to be bound by the terms and conditions of this Creative Commons Attribution-ShareAlike 4.0 International Public License ("Public License"). To the extent this Public License may be interpreted as a contract, You are granted the Licensed Rights in consideration of Your acceptance of these terms and conditions, and the Licensor grants You such rights in consideration of benefits the Licensor receives from making the Licensed Material available under these terms and conditions. 21 | 22 | ### Section 1 – Definitions. 23 | 24 | a. __Adapted Material__ means material subject to Copyright and Similar Rights that is derived from or based upon the Licensed Material and in which the Licensed Material is translated, altered, arranged, transformed, or otherwise modified in a manner requiring permission under the Copyright and Similar Rights held by the Licensor. For purposes of this Public License, where the Licensed Material is a musical work, performance, or sound recording, Adapted Material is always produced where the Licensed Material is synched in timed relation with a moving image. 25 | 26 | b. __Adapter's License__ means the license You apply to Your Copyright and Similar Rights in Your contributions to Adapted Material in accordance with the terms and conditions of this Public License. 27 | 28 | c. __BY-SA Compatible License__ means a license listed at [creativecommons.org/compatiblelicenses](http://creativecommons.org/compatiblelicenses), approved by Creative Commons as essentially the equivalent of this Public License. 29 | 30 | d. __Copyright and Similar Rights__ means copyright and/or similar rights closely related to copyright including, without limitation, performance, broadcast, sound recording, and Sui Generis Database Rights, without regard to how the rights are labeled or categorized. For purposes of this Public License, the rights specified in Section 2(b)(1)-(2) are not Copyright and Similar Rights. 31 | 32 | e. __Effective Technological Measures__ means those measures that, in the absence of proper authority, may not be circumvented under laws fulfilling obligations under Article 11 of the WIPO Copyright Treaty adopted on December 20, 1996, and/or similar international agreements. 33 | 34 | f. __Exceptions and Limitations__ means fair use, fair dealing, and/or any other exception or limitation to Copyright and Similar Rights that applies to Your use of the Licensed Material. 35 | 36 | g. __License Elements__ means the license attributes listed in the name of a Creative Commons Public License. The License Elements of this Public License are Attribution and ShareAlike. 37 | 38 | h. __Licensed Material__ means the artistic or literary work, database, or other material to which the Licensor applied this Public License. 39 | 40 | i. __Licensed Rights__ means the rights granted to You subject to the terms and conditions of this Public License, which are limited to all Copyright and Similar Rights that apply to Your use of the Licensed Material and that the Licensor has authority to license. 41 | 42 | j. __Licensor__ means the individual(s) or entity(ies) granting rights under this Public License. 43 | 44 | k. __Share__ means to provide material to the public by any means or process that requires permission under the Licensed Rights, such as reproduction, public display, public performance, distribution, dissemination, communication, or importation, and to make material available to the public including in ways that members of the public may access the material from a place and at a time individually chosen by them. 45 | 46 | l. __Sui Generis Database Rights__ means rights other than copyright resulting from Directive 96/9/EC of the European Parliament and of the Council of 11 March 1996 on the legal protection of databases, as amended and/or succeeded, as well as other essentially equivalent rights anywhere in the world. 47 | 48 | m. __You__ means the individual or entity exercising the Licensed Rights under this Public License. Your has a corresponding meaning. 49 | 50 | ### Section 2 – Scope. 51 | 52 | a. ___License grant.___ 53 | 54 | 1. Subject to the terms and conditions of this Public License, the Licensor hereby grants You a worldwide, royalty-free, non-sublicensable, non-exclusive, irrevocable license to exercise the Licensed Rights in the Licensed Material to: 55 | 56 | A. reproduce and Share the Licensed Material, in whole or in part; and 57 | 58 | B. produce, reproduce, and Share Adapted Material. 59 | 60 | 2. __Exceptions and Limitations.__ For the avoidance of doubt, where Exceptions and Limitations apply to Your use, this Public License does not apply, and You do not need to comply with its terms and conditions. 61 | 62 | 3. __Term.__ The term of this Public License is specified in Section 6(a). 63 | 64 | 4. __Media and formats; technical modifications allowed.__ The Licensor authorizes You to exercise the Licensed Rights in all media and formats whether now known or hereafter created, and to make technical modifications necessary to do so. The Licensor waives and/or agrees not to assert any right or authority to forbid You from making technical modifications necessary to exercise the Licensed Rights, including technical modifications necessary to circumvent Effective Technological Measures. For purposes of this Public License, simply making modifications authorized by this Section 2(a)(4) never produces Adapted Material. 65 | 66 | 5. __Downstream recipients.__ 67 | 68 | A. __Offer from the Licensor – Licensed Material.__ Every recipient of the Licensed Material automatically receives an offer from the Licensor to exercise the Licensed Rights under the terms and conditions of this Public License. 69 | 70 | B. __Additional offer from the Licensor – Adapted Material.__ Every recipient of Adapted Material from You automatically receives an offer from the Licensor to exercise the Licensed Rights in the Adapted Material under the conditions of the Adapter’s License You apply. 71 | 72 | C. __No downstream restrictions.__ You may not offer or impose any additional or different terms or conditions on, or apply any Effective Technological Measures to, the Licensed Material if doing so restricts exercise of the Licensed Rights by any recipient of the Licensed Material. 73 | 74 | 6. __No endorsement.__ Nothing in this Public License constitutes or may be construed as permission to assert or imply that You are, or that Your use of the Licensed Material is, connected with, or sponsored, endorsed, or granted official status by, the Licensor or others designated to receive attribution as provided in Section 3(a)(1)(A)(i). 75 | 76 | b. ___Other rights.___ 77 | 78 | 1. Moral rights, such as the right of integrity, are not licensed under this Public License, nor are publicity, privacy, and/or other similar personality rights; however, to the extent possible, the Licensor waives and/or agrees not to assert any such rights held by the Licensor to the limited extent necessary to allow You to exercise the Licensed Rights, but not otherwise. 79 | 80 | 2. Patent and trademark rights are not licensed under this Public License. 81 | 82 | 3. To the extent possible, the Licensor waives any right to collect royalties from You for the exercise of the Licensed Rights, whether directly or through a collecting society under any voluntary or waivable statutory or compulsory licensing scheme. In all other cases the Licensor expressly reserves any right to collect such royalties. 83 | 84 | ### Section 3 – License Conditions. 85 | 86 | Your exercise of the Licensed Rights is expressly made subject to the following conditions. 87 | 88 | a. ___Attribution.___ 89 | 90 | 1. If You Share the Licensed Material (including in modified form), You must: 91 | 92 | A. retain the following if it is supplied by the Licensor with the Licensed Material: 93 | 94 | i. identification of the creator(s) of the Licensed Material and any others designated to receive attribution, in any reasonable manner requested by the Licensor (including by pseudonym if designated); 95 | 96 | ii. a copyright notice; 97 | 98 | iii. a notice that refers to this Public License; 99 | 100 | iv. a notice that refers to the disclaimer of warranties; 101 | 102 | v. a URI or hyperlink to the Licensed Material to the extent reasonably practicable; 103 | 104 | B. indicate if You modified the Licensed Material and retain an indication of any previous modifications; and 105 | 106 | C. indicate the Licensed Material is licensed under this Public License, and include the text of, or the URI or hyperlink to, this Public License. 107 | 108 | 2. You may satisfy the conditions in Section 3(a)(1) in any reasonable manner based on the medium, means, and context in which You Share the Licensed Material. For example, it may be reasonable to satisfy the conditions by providing a URI or hyperlink to a resource that includes the required information. 109 | 110 | 3. If requested by the Licensor, You must remove any of the information required by Section 3(a)(1)(A) to the extent reasonably practicable. 111 | 112 | b. ___ShareAlike.___ 113 | 114 | In addition to the conditions in Section 3(a), if You Share Adapted Material You produce, the following conditions also apply. 115 | 116 | 1. The Adapter’s License You apply must be a Creative Commons license with the same License Elements, this version or later, or a BY-SA Compatible License. 117 | 118 | 2. You must include the text of, or the URI or hyperlink to, the Adapter's License You apply. You may satisfy this condition in any reasonable manner based on the medium, means, and context in which You Share Adapted Material. 119 | 120 | 3. You may not offer or impose any additional or different terms or conditions on, or apply any Effective Technological Measures to, Adapted Material that restrict exercise of the rights granted under the Adapter's License You apply. 121 | 122 | ### Section 4 – Sui Generis Database Rights. 123 | 124 | Where the Licensed Rights include Sui Generis Database Rights that apply to Your use of the Licensed Material: 125 | 126 | a. for the avoidance of doubt, Section 2(a)(1) grants You the right to extract, reuse, reproduce, and Share all or a substantial portion of the contents of the database; 127 | 128 | b. if You include all or a substantial portion of the database contents in a database in which You have Sui Generis Database Rights, then the database in which You have Sui Generis Database Rights (but not its individual contents) is Adapted Material, including for purposes of Section 3(b); and 129 | 130 | c. You must comply with the conditions in Section 3(a) if You Share all or a substantial portion of the contents of the database. 131 | 132 | For the avoidance of doubt, this Section 4 supplements and does not replace Your obligations under this Public License where the Licensed Rights include other Copyright and Similar Rights. 133 | 134 | ### Section 5 – Disclaimer of Warranties and Limitation of Liability. 135 | 136 | a. __Unless otherwise separately undertaken by the Licensor, to the extent possible, the Licensor offers the Licensed Material as-is and as-available, and makes no representations or warranties of any kind concerning the Licensed Material, whether express, implied, statutory, or other. This includes, without limitation, warranties of title, merchantability, fitness for a particular purpose, non-infringement, absence of latent or other defects, accuracy, or the presence or absence of errors, whether or not known or discoverable. Where disclaimers of warranties are not allowed in full or in part, this disclaimer may not apply to You.__ 137 | 138 | b. __To the extent possible, in no event will the Licensor be liable to You on any legal theory (including, without limitation, negligence) or otherwise for any direct, special, indirect, incidental, consequential, punitive, exemplary, or other losses, costs, expenses, or damages arising out of this Public License or use of the Licensed Material, even if the Licensor has been advised of the possibility of such losses, costs, expenses, or damages. Where a limitation of liability is not allowed in full or in part, this limitation may not apply to You.__ 139 | 140 | c. The disclaimer of warranties and limitation of liability provided above shall be interpreted in a manner that, to the extent possible, most closely approximates an absolute disclaimer and waiver of all liability. 141 | 142 | ### Section 6 – Term and Termination. 143 | 144 | a. This Public License applies for the term of the Copyright and Similar Rights licensed here. However, if You fail to comply with this Public License, then Your rights under this Public License terminate automatically. 145 | 146 | b. Where Your right to use the Licensed Material has terminated under Section 6(a), it reinstates: 147 | 148 | 1. automatically as of the date the violation is cured, provided it is cured within 30 days of Your discovery of the violation; or 149 | 150 | 2. upon express reinstatement by the Licensor. 151 | 152 | For the avoidance of doubt, this Section 6(b) does not affect any right the Licensor may have to seek remedies for Your violations of this Public License. 153 | 154 | c. For the avoidance of doubt, the Licensor may also offer the Licensed Material under separate terms or conditions or stop distributing the Licensed Material at any time; however, doing so will not terminate this Public License. 155 | 156 | d. Sections 1, 5, 6, 7, and 8 survive termination of this Public License. 157 | 158 | ### Section 7 – Other Terms and Conditions. 159 | 160 | a. The Licensor shall not be bound by any additional or different terms or conditions communicated by You unless expressly agreed. 161 | 162 | b. Any arrangements, understandings, or agreements regarding the Licensed Material not stated herein are separate from and independent of the terms and conditions of this Public License.t stated herein are separate from and independent of the terms and conditions of this Public License. 163 | 164 | ### Section 8 – Interpretation. 165 | 166 | a. For the avoidance of doubt, this Public License does not, and shall not be interpreted to, reduce, limit, restrict, or impose conditions on any use of the Licensed Material that could lawfully be made without permission under this Public License. 167 | 168 | b. To the extent possible, if any provision of this Public License is deemed unenforceable, it shall be automatically reformed to the minimum extent necessary to make it enforceable. If the provision cannot be reformed, it shall be severed from this Public License without affecting the enforceability of the remaining terms and conditions. 169 | 170 | c. No term or condition of this Public License will be waived and no failure to comply consented to unless expressly agreed to by the Licensor. 171 | 172 | d. Nothing in this Public License constitutes or may be interpreted as a limitation upon, or waiver of, any privileges and immunities that apply to the Licensor or You, including from the legal processes of any jurisdiction or authority. 173 | 174 | ``` 175 | Creative Commons is not a party to its public licenses. Notwithstanding, Creative Commons may elect to apply one of its public licenses to material it publishes and in those instances will be considered the “Licensor.” Except for the limited purpose of indicating that material is shared under a Creative Commons public license or as otherwise permitted by the Creative Commons policies published at [creativecommons.org/policies](http://creativecommons.org/policies), Creative Commons does not authorize the use of the trademark “Creative Commons” or any other trademark or logo of Creative Commons without its prior written consent including, without limitation, in connection with any unauthorized modifications to any of its public licenses or any other arrangements, understandings, or agreements concerning use of licensed material. For the avoidance of doubt, this paragraph does not form part of the public licenses. 176 | 177 | Creative Commons may be contacted at [creativecommons.org](http://creativecommons.org/). 178 | ``` 179 | -------------------------------------------------------------------------------- /hardware/README.md: -------------------------------------------------------------------------------- 1 | # Hardware 2 | 3 | If you are looking to to print shapes of a poppy-ergo-jr, you can download STL files on the last [GitHub release](https://github.com/poppy-project/poppy-ergo-jr/releases). 4 | 5 | ## Onshape version 6 | The up to date hardware version is made with [Onshape](https://www.onshape.com/), which is a proprietary online CAD software, free to use for public projects. 7 | 8 | You can view and modify the hardware parts on Onshape ([link of the onshape project](https://cad.onshape.com/documents/57024ba6e4b0bd431e251b54/v/f9f9475a8e982b501b19085f/e/ed40471c06b378f3c094c206)), but an account (free) is required. 9 | 10 | 11 | ## OpenScad version 12 | Poppy Ergo Jr was originally made by Jonathan Grizou (@jgrizou) with [OpenScad](http://www.openscad.org/). 13 | This was inspired by the [Metabot project](https://github.com/Rhoban/Metabot/). 14 | 15 | The OpenScad version of hardware is kept [here](https://github.com/poppy-project/poppy-ergo-jr/tree/design-with-openSCAD) for memory and educational example of an OpenScad project, but it is __no longer maintained__. 16 | 17 | 18 | ## Community 19 | An alternative version made by S. Brunel [can be found on Thingiverse](http://www.thingiverse.com/thing:1246862). 20 | -------------------------------------------------------------------------------- /hardware/STEP/U_parts.step: -------------------------------------------------------------------------------- 1 | version https://git-lfs.github.com/spec/v1 2 | oid sha256:099ea2c65bb806e280d8e2a06b30f002be026a2dc6f72785559c794e6248c056 3 | size 199480 4 | -------------------------------------------------------------------------------- /hardware/STEP/base.step: -------------------------------------------------------------------------------- 1 | version https://git-lfs.github.com/spec/v1 2 | oid sha256:c6f222b8cb2bd227412fad26ee7f5eeb8a1c56c1555b45d4d3072bd74c164e5a 3 | size 1978470 4 | -------------------------------------------------------------------------------- /hardware/STEP/lateral_parts.step: -------------------------------------------------------------------------------- 1 | version https://git-lfs.github.com/spec/v1 2 | oid sha256:f4a3494e56e9543655446a23b73b3e583146f86940e4dd88ba044188f36d28ed 3 | size 141207 4 | -------------------------------------------------------------------------------- /hardware/STEP/tools/gripper.step: -------------------------------------------------------------------------------- 1 | version https://git-lfs.github.com/spec/v1 2 | oid sha256:f67540cef54d364f57d19afdf3019e4fe453319d8034a073f4e73564e3c8e9ee 3 | size 4272252 4 | -------------------------------------------------------------------------------- /hardware/STEP/tools/lamp.step: -------------------------------------------------------------------------------- 1 | version https://git-lfs.github.com/spec/v1 2 | oid sha256:8a184f46c837b5a2790500c286f44824ea24c04f8d2d26ed3bab5a6f2a580eac 3 | size 592052 4 | -------------------------------------------------------------------------------- /hardware/STEP/tools/pen_holder.step: -------------------------------------------------------------------------------- 1 | version https://git-lfs.github.com/spec/v1 2 | oid sha256:98454bb9cfea53ae83bc81db3590a2c5cd56bc7eae55ae6e1938fced0a466675 3 | size 645245 4 | -------------------------------------------------------------------------------- /hardware/STL/4dofs-horn2horn.stl: -------------------------------------------------------------------------------- 1 | version https://git-lfs.github.com/spec/v1 2 | oid sha256:e3bb0d3d31333e7bd477c851ab00ff212a0bdfa4314b70a6625812c378e7fb95 3 | size 2471284 4 | -------------------------------------------------------------------------------- /hardware/STL/4dofs-side2side.stl: -------------------------------------------------------------------------------- 1 | version https://git-lfs.github.com/spec/v1 2 | oid sha256:efff784d604af89e60b29c2538dac6762e5312ad1635f5d7c0c7a29d5e9cbd52 3 | size 2527084 4 | -------------------------------------------------------------------------------- /hardware/STL/base.stl: -------------------------------------------------------------------------------- 1 | version https://git-lfs.github.com/spec/v1 2 | oid sha256:c3150095267a94d0df530167b9bb22d22d00ec74918969fdbf33aa83f77ca63b 3 | size 5144484 4 | -------------------------------------------------------------------------------- /hardware/STL/disk_support.stl: -------------------------------------------------------------------------------- 1 | version https://git-lfs.github.com/spec/v1 2 | oid sha256:45941750fa44a9b625d471589e919e69b5d0e881c435da8f733b7bb797fe8827 3 | size 1051284 4 | -------------------------------------------------------------------------------- /hardware/STL/horn2horn.stl: -------------------------------------------------------------------------------- 1 | version https://git-lfs.github.com/spec/v1 2 | oid sha256:cc6d40d692c6d12e4ad16f9566cf90b6e401c1a46848564d8dda83072ed75dbb 3 | size 240084 4 | -------------------------------------------------------------------------------- /hardware/STL/long_U.stl: -------------------------------------------------------------------------------- 1 | version https://git-lfs.github.com/spec/v1 2 | oid sha256:8f6b02d1be0517bb018c28496cc8d4129be730b838f8db11ea8e93f3711fe0fe 3 | size 1381984 4 | -------------------------------------------------------------------------------- /hardware/STL/short_U.stl: -------------------------------------------------------------------------------- 1 | version https://git-lfs.github.com/spec/v1 2 | oid sha256:aeb94f32e01d08db7a00f137fec3b970a2d7247b4b3447dea5c84f4382c1efd1 3 | size 337484 4 | -------------------------------------------------------------------------------- /hardware/STL/side2side.stl: -------------------------------------------------------------------------------- 1 | version https://git-lfs.github.com/spec/v1 2 | oid sha256:0527075781cdb4221049aa5d0fef7d218e132986196dadcee7b82862985c4d02 3 | size 1208384 4 | -------------------------------------------------------------------------------- /hardware/STL/support_camera.stl: -------------------------------------------------------------------------------- 1 | version https://git-lfs.github.com/spec/v1 2 | oid sha256:f26f269ffd4ca92fc5d4615e3f7bdcd20519e8a5909ce94ace47295ecbd72969 3 | size 1620684 4 | -------------------------------------------------------------------------------- /hardware/STL/tools/gripper-fixation.stl: -------------------------------------------------------------------------------- 1 | version https://git-lfs.github.com/spec/v1 2 | oid sha256:52663bd2b410975eaf59751bdbd981dd51ce24b9356cf13acf8508e975b61c4c 3 | size 469484 4 | -------------------------------------------------------------------------------- /hardware/STL/tools/gripper-fixed_part.stl: -------------------------------------------------------------------------------- 1 | version https://git-lfs.github.com/spec/v1 2 | oid sha256:78d22d532083d36677f54f75575d5bd9a2208222eafda29a12f7cb0144b368a6 3 | size 372184 4 | -------------------------------------------------------------------------------- /hardware/STL/tools/gripper-rotative_part.stl: -------------------------------------------------------------------------------- 1 | version https://git-lfs.github.com/spec/v1 2 | oid sha256:c4afe084b66d845d64fa19e9c82c457b171f6f85538500aa532bec783ca1eac6 3 | size 1608484 4 | -------------------------------------------------------------------------------- /hardware/STL/tools/lamp.stl: -------------------------------------------------------------------------------- 1 | version https://git-lfs.github.com/spec/v1 2 | oid sha256:0e50be877fe1179628f37011d4e1fcdcbfc823b1be6343a77d70a6f4cd4454ba 3 | size 3450184 4 | -------------------------------------------------------------------------------- /hardware/STL/tools/pen-holder.stl: -------------------------------------------------------------------------------- 1 | version https://git-lfs.github.com/spec/v1 2 | oid sha256:510c62f06bd30ae33dbf3446f3ca15d9b81fad0a45046d1abdcaf59efb3da6e8 3 | size 1628484 4 | -------------------------------------------------------------------------------- /hardware/STL/tools/pen-screw.stl: -------------------------------------------------------------------------------- 1 | version https://git-lfs.github.com/spec/v1 2 | oid sha256:ce91ae2cf0288154fda0b6877a3030db1ba7c35028ee80a75405ab593ab2258c 3 | size 1288884 4 | -------------------------------------------------------------------------------- /hardware/laser_cutting/4dof-parts.pdf: -------------------------------------------------------------------------------- 1 | version https://git-lfs.github.com/spec/v1 2 | oid sha256:7cf9280301b95cfd9d2de54b8641289b31d5675b341e6feabf231c6b37e61171 3 | size 7140 4 | -------------------------------------------------------------------------------- /hardware/laser_cutting/disk_support.pdf: -------------------------------------------------------------------------------- 1 | version https://git-lfs.github.com/spec/v1 2 | oid sha256:43479a2b8d283cbacb753b0e3c85263faeb3b57f6894405175d7f7cfb630c1cb 3 | size 17507 4 | -------------------------------------------------------------------------------- /software/LICENSE: -------------------------------------------------------------------------------- 1 | GNU GENERAL PUBLIC LICENSE 2 | Version 3, 29 June 2007 3 | 4 | Copyright (C) 2007 Free Software Foundation, Inc. 5 | Everyone is permitted to copy and distribute verbatim copies 6 | of this license document, but changing it is not allowed. 7 | 8 | Preamble 9 | 10 | The GNU General Public License is a free, copyleft license for 11 | software and other kinds of works. 12 | 13 | The licenses for most software and other practical works are designed 14 | to take away your freedom to share and change the works. By contrast, 15 | the GNU General Public License is intended to guarantee your freedom to 16 | share and change all versions of a program--to make sure it remains free 17 | software for all its users. We, the Free Software Foundation, use the 18 | GNU General Public License for most of our software; it applies also to 19 | any other work released this way by its authors. You can apply it to 20 | your programs, too. 21 | 22 | When we speak of free software, we are referring to freedom, not 23 | price. Our General Public Licenses are designed to make sure that you 24 | have the freedom to distribute copies of free software (and charge for 25 | them if you wish), that you receive source code or can get it if you 26 | want it, that you can change the software or use pieces of it in new 27 | free programs, and that you know you can do these things. 28 | 29 | To protect your rights, we need to prevent others from denying you 30 | these rights or asking you to surrender the rights. Therefore, you have 31 | certain responsibilities if you distribute copies of the software, or if 32 | you modify it: responsibilities to respect the freedom of others. 33 | 34 | For example, if you distribute copies of such a program, whether 35 | gratis or for a fee, you must pass on to the recipients the same 36 | freedoms that you received. You must make sure that they, too, receive 37 | or can get the source code. And you must show them these terms so they 38 | know their rights. 39 | 40 | Developers that use the GNU GPL protect your rights with two steps: 41 | (1) assert copyright on the software, and (2) offer you this License 42 | giving you legal permission to copy, distribute and/or modify it. 43 | 44 | For the developers' and authors' protection, the GPL clearly explains 45 | that there is no warranty for this free software. For both users' and 46 | authors' sake, the GPL requires that modified versions be marked as 47 | changed, so that their problems will not be attributed erroneously to 48 | authors of previous versions. 49 | 50 | Some devices are designed to deny users access to install or run 51 | modified versions of the software inside them, although the manufacturer 52 | can do so. This is fundamentally incompatible with the aim of 53 | protecting users' freedom to change the software. The systematic 54 | pattern of such abuse occurs in the area of products for individuals to 55 | use, which is precisely where it is most unacceptable. Therefore, we 56 | have designed this version of the GPL to prohibit the practice for those 57 | products. If such problems arise substantially in other domains, we 58 | stand ready to extend this provision to those domains in future versions 59 | of the GPL, as needed to protect the freedom of users. 60 | 61 | Finally, every program is threatened constantly by software patents. 62 | States should not allow patents to restrict development and use of 63 | software on general-purpose computers, but in those that do, we wish to 64 | avoid the special danger that patents applied to a free program could 65 | make it effectively proprietary. To prevent this, the GPL assures that 66 | patents cannot be used to render the program non-free. 67 | 68 | The precise terms and conditions for copying, distribution and 69 | modification follow. 70 | 71 | TERMS AND CONDITIONS 72 | 73 | 0. Definitions. 74 | 75 | "This License" refers to version 3 of the GNU General Public License. 76 | 77 | "Copyright" also means copyright-like laws that apply to other kinds of 78 | works, such as semiconductor masks. 79 | 80 | "The Program" refers to any copyrightable work licensed under this 81 | License. Each licensee is addressed as "you". "Licensees" and 82 | "recipients" may be individuals or organizations. 83 | 84 | To "modify" a work means to copy from or adapt all or part of the work 85 | in a fashion requiring copyright permission, other than the making of an 86 | exact copy. The resulting work is called a "modified version" of the 87 | earlier work or a work "based on" the earlier work. 88 | 89 | A "covered work" means either the unmodified Program or a work based 90 | on the Program. 91 | 92 | To "propagate" a work means to do anything with it that, without 93 | permission, would make you directly or secondarily liable for 94 | infringement under applicable copyright law, except executing it on a 95 | computer or modifying a private copy. Propagation includes copying, 96 | distribution (with or without modification), making available to the 97 | public, and in some countries other activities as well. 98 | 99 | To "convey" a work means any kind of propagation that enables other 100 | parties to make or receive copies. Mere interaction with a user through 101 | a computer network, with no transfer of a copy, is not conveying. 102 | 103 | An interactive user interface displays "Appropriate Legal Notices" 104 | to the extent that it includes a convenient and prominently visible 105 | feature that (1) displays an appropriate copyright notice, and (2) 106 | tells the user that there is no warranty for the work (except to the 107 | extent that warranties are provided), that licensees may convey the 108 | work under this License, and how to view a copy of this License. If 109 | the interface presents a list of user commands or options, such as a 110 | menu, a prominent item in the list meets this criterion. 111 | 112 | 1. Source Code. 113 | 114 | The "source code" for a work means the preferred form of the work 115 | for making modifications to it. "Object code" means any non-source 116 | form of a work. 117 | 118 | A "Standard Interface" means an interface that either is an official 119 | standard defined by a recognized standards body, or, in the case of 120 | interfaces specified for a particular programming language, one that 121 | is widely used among developers working in that language. 122 | 123 | The "System Libraries" of an executable work include anything, other 124 | than the work as a whole, that (a) is included in the normal form of 125 | packaging a Major Component, but which is not part of that Major 126 | Component, and (b) serves only to enable use of the work with that 127 | Major Component, or to implement a Standard Interface for which an 128 | implementation is available to the public in source code form. A 129 | "Major Component", in this context, means a major essential component 130 | (kernel, window system, and so on) of the specific operating system 131 | (if any) on which the executable work runs, or a compiler used to 132 | produce the work, or an object code interpreter used to run it. 133 | 134 | The "Corresponding Source" for a work in object code form means all 135 | the source code needed to generate, install, and (for an executable 136 | work) run the object code and to modify the work, including scripts to 137 | control those activities. However, it does not include the work's 138 | System Libraries, or general-purpose tools or generally available free 139 | programs which are used unmodified in performing those activities but 140 | which are not part of the work. For example, Corresponding Source 141 | includes interface definition files associated with source files for 142 | the work, and the source code for shared libraries and dynamically 143 | linked subprograms that the work is specifically designed to require, 144 | such as by intimate data communication or control flow between those 145 | subprograms and other parts of the work. 146 | 147 | The Corresponding Source need not include anything that users 148 | can regenerate automatically from other parts of the Corresponding 149 | Source. 150 | 151 | The Corresponding Source for a work in source code form is that 152 | same work. 153 | 154 | 2. Basic Permissions. 155 | 156 | All rights granted under this License are granted for the term of 157 | copyright on the Program, and are irrevocable provided the stated 158 | conditions are met. This License explicitly affirms your unlimited 159 | permission to run the unmodified Program. The output from running a 160 | covered work is covered by this License only if the output, given its 161 | content, constitutes a covered work. This License acknowledges your 162 | rights of fair use or other equivalent, as provided by copyright law. 163 | 164 | You may make, run and propagate covered works that you do not 165 | convey, without conditions so long as your license otherwise remains 166 | in force. You may convey covered works to others for the sole purpose 167 | of having them make modifications exclusively for you, or provide you 168 | with facilities for running those works, provided that you comply with 169 | the terms of this License in conveying all material for which you do 170 | not control copyright. Those thus making or running the covered works 171 | for you must do so exclusively on your behalf, under your direction 172 | and control, on terms that prohibit them from making any copies of 173 | your copyrighted material outside their relationship with you. 174 | 175 | Conveying under any other circumstances is permitted solely under 176 | the conditions stated below. Sublicensing is not allowed; section 10 177 | makes it unnecessary. 178 | 179 | 3. Protecting Users' Legal Rights From Anti-Circumvention Law. 180 | 181 | No covered work shall be deemed part of an effective technological 182 | measure under any applicable law fulfilling obligations under article 183 | 11 of the WIPO copyright treaty adopted on 20 December 1996, or 184 | similar laws prohibiting or restricting circumvention of such 185 | measures. 186 | 187 | When you convey a covered work, you waive any legal power to forbid 188 | circumvention of technological measures to the extent such circumvention 189 | is effected by exercising rights under this License with respect to 190 | the covered work, and you disclaim any intention to limit operation or 191 | modification of the work as a means of enforcing, against the work's 192 | users, your or third parties' legal rights to forbid circumvention of 193 | technological measures. 194 | 195 | 4. Conveying Verbatim Copies. 196 | 197 | You may convey verbatim copies of the Program's source code as you 198 | receive it, in any medium, provided that you conspicuously and 199 | appropriately publish on each copy an appropriate copyright notice; 200 | keep intact all notices stating that this License and any 201 | non-permissive terms added in accord with section 7 apply to the code; 202 | keep intact all notices of the absence of any warranty; and give all 203 | recipients a copy of this License along with the Program. 204 | 205 | You may charge any price or no price for each copy that you convey, 206 | and you may offer support or warranty protection for a fee. 207 | 208 | 5. Conveying Modified Source Versions. 209 | 210 | You may convey a work based on the Program, or the modifications to 211 | produce it from the Program, in the form of source code under the 212 | terms of section 4, provided that you also meet all of these conditions: 213 | 214 | a) The work must carry prominent notices stating that you modified 215 | it, and giving a relevant date. 216 | 217 | b) The work must carry prominent notices stating that it is 218 | released under this License and any conditions added under section 219 | 7. This requirement modifies the requirement in section 4 to 220 | "keep intact all notices". 221 | 222 | c) You must license the entire work, as a whole, under this 223 | License to anyone who comes into possession of a copy. This 224 | License will therefore apply, along with any applicable section 7 225 | additional terms, to the whole of the work, and all its parts, 226 | regardless of how they are packaged. This License gives no 227 | permission to license the work in any other way, but it does not 228 | invalidate such permission if you have separately received it. 229 | 230 | d) If the work has interactive user interfaces, each must display 231 | Appropriate Legal Notices; however, if the Program has interactive 232 | interfaces that do not display Appropriate Legal Notices, your 233 | work need not make them do so. 234 | 235 | A compilation of a covered work with other separate and independent 236 | works, which are not by their nature extensions of the covered work, 237 | and which are not combined with it such as to form a larger program, 238 | in or on a volume of a storage or distribution medium, is called an 239 | "aggregate" if the compilation and its resulting copyright are not 240 | used to limit the access or legal rights of the compilation's users 241 | beyond what the individual works permit. Inclusion of a covered work 242 | in an aggregate does not cause this License to apply to the other 243 | parts of the aggregate. 244 | 245 | 6. Conveying Non-Source Forms. 246 | 247 | You may convey a covered work in object code form under the terms 248 | of sections 4 and 5, provided that you also convey the 249 | machine-readable Corresponding Source under the terms of this License, 250 | in one of these ways: 251 | 252 | a) Convey the object code in, or embodied in, a physical product 253 | (including a physical distribution medium), accompanied by the 254 | Corresponding Source fixed on a durable physical medium 255 | customarily used for software interchange. 256 | 257 | b) Convey the object code in, or embodied in, a physical product 258 | (including a physical distribution medium), accompanied by a 259 | written offer, valid for at least three years and valid for as 260 | long as you offer spare parts or customer support for that product 261 | model, to give anyone who possesses the object code either (1) a 262 | copy of the Corresponding Source for all the software in the 263 | product that is covered by this License, on a durable physical 264 | medium customarily used for software interchange, for a price no 265 | more than your reasonable cost of physically performing this 266 | conveying of source, or (2) access to copy the 267 | Corresponding Source from a network server at no charge. 268 | 269 | c) Convey individual copies of the object code with a copy of the 270 | written offer to provide the Corresponding Source. This 271 | alternative is allowed only occasionally and noncommercially, and 272 | only if you received the object code with such an offer, in accord 273 | with subsection 6b. 274 | 275 | d) Convey the object code by offering access from a designated 276 | place (gratis or for a charge), and offer equivalent access to the 277 | Corresponding Source in the same way through the same place at no 278 | further charge. You need not require recipients to copy the 279 | Corresponding Source along with the object code. If the place to 280 | copy the object code is a network server, the Corresponding Source 281 | may be on a different server (operated by you or a third party) 282 | that supports equivalent copying facilities, provided you maintain 283 | clear directions next to the object code saying where to find the 284 | Corresponding Source. Regardless of what server hosts the 285 | Corresponding Source, you remain obligated to ensure that it is 286 | available for as long as needed to satisfy these requirements. 287 | 288 | e) Convey the object code using peer-to-peer transmission, provided 289 | you inform other peers where the object code and Corresponding 290 | Source of the work are being offered to the general public at no 291 | charge under subsection 6d. 292 | 293 | A separable portion of the object code, whose source code is excluded 294 | from the Corresponding Source as a System Library, need not be 295 | included in conveying the object code work. 296 | 297 | A "User Product" is either (1) a "consumer product", which means any 298 | tangible personal property which is normally used for personal, family, 299 | or household purposes, or (2) anything designed or sold for incorporation 300 | into a dwelling. In determining whether a product is a consumer product, 301 | doubtful cases shall be resolved in favor of coverage. For a particular 302 | product received by a particular user, "normally used" refers to a 303 | typical or common use of that class of product, regardless of the status 304 | of the particular user or of the way in which the particular user 305 | actually uses, or expects or is expected to use, the product. A product 306 | is a consumer product regardless of whether the product has substantial 307 | commercial, industrial or non-consumer uses, unless such uses represent 308 | the only significant mode of use of the product. 309 | 310 | "Installation Information" for a User Product means any methods, 311 | procedures, authorization keys, or other information required to install 312 | and execute modified versions of a covered work in that User Product from 313 | a modified version of its Corresponding Source. The information must 314 | suffice to ensure that the continued functioning of the modified object 315 | code is in no case prevented or interfered with solely because 316 | modification has been made. 317 | 318 | If you convey an object code work under this section in, or with, or 319 | specifically for use in, a User Product, and the conveying occurs as 320 | part of a transaction in which the right of possession and use of the 321 | User Product is transferred to the recipient in perpetuity or for a 322 | fixed term (regardless of how the transaction is characterized), the 323 | Corresponding Source conveyed under this section must be accompanied 324 | by the Installation Information. But this requirement does not apply 325 | if neither you nor any third party retains the ability to install 326 | modified object code on the User Product (for example, the work has 327 | been installed in ROM). 328 | 329 | The requirement to provide Installation Information does not include a 330 | requirement to continue to provide support service, warranty, or updates 331 | for a work that has been modified or installed by the recipient, or for 332 | the User Product in which it has been modified or installed. Access to a 333 | network may be denied when the modification itself materially and 334 | adversely affects the operation of the network or violates the rules and 335 | protocols for communication across the network. 336 | 337 | Corresponding Source conveyed, and Installation Information provided, 338 | in accord with this section must be in a format that is publicly 339 | documented (and with an implementation available to the public in 340 | source code form), and must require no special password or key for 341 | unpacking, reading or copying. 342 | 343 | 7. Additional Terms. 344 | 345 | "Additional permissions" are terms that supplement the terms of this 346 | License by making exceptions from one or more of its conditions. 347 | Additional permissions that are applicable to the entire Program shall 348 | be treated as though they were included in this License, to the extent 349 | that they are valid under applicable law. If additional permissions 350 | apply only to part of the Program, that part may be used separately 351 | under those permissions, but the entire Program remains governed by 352 | this License without regard to the additional permissions. 353 | 354 | When you convey a copy of a covered work, you may at your option 355 | remove any additional permissions from that copy, or from any part of 356 | it. (Additional permissions may be written to require their own 357 | removal in certain cases when you modify the work.) You may place 358 | additional permissions on material, added by you to a covered work, 359 | for which you have or can give appropriate copyright permission. 360 | 361 | Notwithstanding any other provision of this License, for material you 362 | add to a covered work, you may (if authorized by the copyright holders of 363 | that material) supplement the terms of this License with terms: 364 | 365 | a) Disclaiming warranty or limiting liability differently from the 366 | terms of sections 15 and 16 of this License; or 367 | 368 | b) Requiring preservation of specified reasonable legal notices or 369 | author attributions in that material or in the Appropriate Legal 370 | Notices displayed by works containing it; or 371 | 372 | c) Prohibiting misrepresentation of the origin of that material, or 373 | requiring that modified versions of such material be marked in 374 | reasonable ways as different from the original version; or 375 | 376 | d) Limiting the use for publicity purposes of names of licensors or 377 | authors of the material; or 378 | 379 | e) Declining to grant rights under trademark law for use of some 380 | trade names, trademarks, or service marks; or 381 | 382 | f) Requiring indemnification of licensors and authors of that 383 | material by anyone who conveys the material (or modified versions of 384 | it) with contractual assumptions of liability to the recipient, for 385 | any liability that these contractual assumptions directly impose on 386 | those licensors and authors. 387 | 388 | All other non-permissive additional terms are considered "further 389 | restrictions" within the meaning of section 10. If the Program as you 390 | received it, or any part of it, contains a notice stating that it is 391 | governed by this License along with a term that is a further 392 | restriction, you may remove that term. If a license document contains 393 | a further restriction but permits relicensing or conveying under this 394 | License, you may add to a covered work material governed by the terms 395 | of that license document, provided that the further restriction does 396 | not survive such relicensing or conveying. 397 | 398 | If you add terms to a covered work in accord with this section, you 399 | must place, in the relevant source files, a statement of the 400 | additional terms that apply to those files, or a notice indicating 401 | where to find the applicable terms. 402 | 403 | Additional terms, permissive or non-permissive, may be stated in the 404 | form of a separately written license, or stated as exceptions; 405 | the above requirements apply either way. 406 | 407 | 8. Termination. 408 | 409 | You may not propagate or modify a covered work except as expressly 410 | provided under this License. Any attempt otherwise to propagate or 411 | modify it is void, and will automatically terminate your rights under 412 | this License (including any patent licenses granted under the third 413 | paragraph of section 11). 414 | 415 | However, if you cease all violation of this License, then your 416 | license from a particular copyright holder is reinstated (a) 417 | provisionally, unless and until the copyright holder explicitly and 418 | finally terminates your license, and (b) permanently, if the copyright 419 | holder fails to notify you of the violation by some reasonable means 420 | prior to 60 days after the cessation. 421 | 422 | Moreover, your license from a particular copyright holder is 423 | reinstated permanently if the copyright holder notifies you of the 424 | violation by some reasonable means, this is the first time you have 425 | received notice of violation of this License (for any work) from that 426 | copyright holder, and you cure the violation prior to 30 days after 427 | your receipt of the notice. 428 | 429 | Termination of your rights under this section does not terminate the 430 | licenses of parties who have received copies or rights from you under 431 | this License. If your rights have been terminated and not permanently 432 | reinstated, you do not qualify to receive new licenses for the same 433 | material under section 10. 434 | 435 | 9. Acceptance Not Required for Having Copies. 436 | 437 | You are not required to accept this License in order to receive or 438 | run a copy of the Program. Ancillary propagation of a covered work 439 | occurring solely as a consequence of using peer-to-peer transmission 440 | to receive a copy likewise does not require acceptance. However, 441 | nothing other than this License grants you permission to propagate or 442 | modify any covered work. These actions infringe copyright if you do 443 | not accept this License. Therefore, by modifying or propagating a 444 | covered work, you indicate your acceptance of this License to do so. 445 | 446 | 10. Automatic Licensing of Downstream Recipients. 447 | 448 | Each time you convey a covered work, the recipient automatically 449 | receives a license from the original licensors, to run, modify and 450 | propagate that work, subject to this License. You are not responsible 451 | for enforcing compliance by third parties with this License. 452 | 453 | An "entity transaction" is a transaction transferring control of an 454 | organization, or substantially all assets of one, or subdividing an 455 | organization, or merging organizations. If propagation of a covered 456 | work results from an entity transaction, each party to that 457 | transaction who receives a copy of the work also receives whatever 458 | licenses to the work the party's predecessor in interest had or could 459 | give under the previous paragraph, plus a right to possession of the 460 | Corresponding Source of the work from the predecessor in interest, if 461 | the predecessor has it or can get it with reasonable efforts. 462 | 463 | You may not impose any further restrictions on the exercise of the 464 | rights granted or affirmed under this License. For example, you may 465 | not impose a license fee, royalty, or other charge for exercise of 466 | rights granted under this License, and you may not initiate litigation 467 | (including a cross-claim or counterclaim in a lawsuit) alleging that 468 | any patent claim is infringed by making, using, selling, offering for 469 | sale, or importing the Program or any portion of it. 470 | 471 | 11. Patents. 472 | 473 | A "contributor" is a copyright holder who authorizes use under this 474 | License of the Program or a work on which the Program is based. The 475 | work thus licensed is called the contributor's "contributor version". 476 | 477 | A contributor's "essential patent claims" are all patent claims 478 | owned or controlled by the contributor, whether already acquired or 479 | hereafter acquired, that would be infringed by some manner, permitted 480 | by this License, of making, using, or selling its contributor version, 481 | but do not include claims that would be infringed only as a 482 | consequence of further modification of the contributor version. For 483 | purposes of this definition, "control" includes the right to grant 484 | patent sublicenses in a manner consistent with the requirements of 485 | this License. 486 | 487 | Each contributor grants you a non-exclusive, worldwide, royalty-free 488 | patent license under the contributor's essential patent claims, to 489 | make, use, sell, offer for sale, import and otherwise run, modify and 490 | propagate the contents of its contributor version. 491 | 492 | In the following three paragraphs, a "patent license" is any express 493 | agreement or commitment, however denominated, not to enforce a patent 494 | (such as an express permission to practice a patent or covenant not to 495 | sue for patent infringement). To "grant" such a patent license to a 496 | party means to make such an agreement or commitment not to enforce a 497 | patent against the party. 498 | 499 | If you convey a covered work, knowingly relying on a patent license, 500 | and the Corresponding Source of the work is not available for anyone 501 | to copy, free of charge and under the terms of this License, through a 502 | publicly available network server or other readily accessible means, 503 | then you must either (1) cause the Corresponding Source to be so 504 | available, or (2) arrange to deprive yourself of the benefit of the 505 | patent license for this particular work, or (3) arrange, in a manner 506 | consistent with the requirements of this License, to extend the patent 507 | license to downstream recipients. "Knowingly relying" means you have 508 | actual knowledge that, but for the patent license, your conveying the 509 | covered work in a country, or your recipient's use of the covered work 510 | in a country, would infringe one or more identifiable patents in that 511 | country that you have reason to believe are valid. 512 | 513 | If, pursuant to or in connection with a single transaction or 514 | arrangement, you convey, or propagate by procuring conveyance of, a 515 | covered work, and grant a patent license to some of the parties 516 | receiving the covered work authorizing them to use, propagate, modify 517 | or convey a specific copy of the covered work, then the patent license 518 | you grant is automatically extended to all recipients of the covered 519 | work and works based on it. 520 | 521 | A patent license is "discriminatory" if it does not include within 522 | the scope of its coverage, prohibits the exercise of, or is 523 | conditioned on the non-exercise of one or more of the rights that are 524 | specifically granted under this License. You may not convey a covered 525 | work if you are a party to an arrangement with a third party that is 526 | in the business of distributing software, under which you make payment 527 | to the third party based on the extent of your activity of conveying 528 | the work, and under which the third party grants, to any of the 529 | parties who would receive the covered work from you, a discriminatory 530 | patent license (a) in connection with copies of the covered work 531 | conveyed by you (or copies made from those copies), or (b) primarily 532 | for and in connection with specific products or compilations that 533 | contain the covered work, unless you entered into that arrangement, 534 | or that patent license was granted, prior to 28 March 2007. 535 | 536 | Nothing in this License shall be construed as excluding or limiting 537 | any implied license or other defenses to infringement that may 538 | otherwise be available to you under applicable patent law. 539 | 540 | 12. No Surrender of Others' Freedom. 541 | 542 | If conditions are imposed on you (whether by court order, agreement or 543 | otherwise) that contradict the conditions of this License, they do not 544 | excuse you from the conditions of this License. If you cannot convey a 545 | covered work so as to satisfy simultaneously your obligations under this 546 | License and any other pertinent obligations, then as a consequence you may 547 | not convey it at all. For example, if you agree to terms that obligate you 548 | to collect a royalty for further conveying from those to whom you convey 549 | the Program, the only way you could satisfy both those terms and this 550 | License would be to refrain entirely from conveying the Program. 551 | 552 | 13. Use with the GNU Affero General Public License. 553 | 554 | Notwithstanding any other provision of this License, you have 555 | permission to link or combine any covered work with a work licensed 556 | under version 3 of the GNU Affero General Public License into a single 557 | combined work, and to convey the resulting work. The terms of this 558 | License will continue to apply to the part which is the covered work, 559 | but the special requirements of the GNU Affero General Public License, 560 | section 13, concerning interaction through a network will apply to the 561 | combination as such. 562 | 563 | 14. Revised Versions of this License. 564 | 565 | The Free Software Foundation may publish revised and/or new versions of 566 | the GNU General Public License from time to time. Such new versions will 567 | be similar in spirit to the present version, but may differ in detail to 568 | address new problems or concerns. 569 | 570 | Each version is given a distinguishing version number. If the 571 | Program specifies that a certain numbered version of the GNU General 572 | Public License "or any later version" applies to it, you have the 573 | option of following the terms and conditions either of that numbered 574 | version or of any later version published by the Free Software 575 | Foundation. If the Program does not specify a version number of the 576 | GNU General Public License, you may choose any version ever published 577 | by the Free Software Foundation. 578 | 579 | If the Program specifies that a proxy can decide which future 580 | versions of the GNU General Public License can be used, that proxy's 581 | public statement of acceptance of a version permanently authorizes you 582 | to choose that version for the Program. 583 | 584 | Later license versions may give you additional or different 585 | permissions. However, no additional obligations are imposed on any 586 | author or copyright holder as a result of your choosing to follow a 587 | later version. 588 | 589 | 15. Disclaimer of Warranty. 590 | 591 | THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY 592 | APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT 593 | HOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY 594 | OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, 595 | THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR 596 | PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE PROGRAM 597 | IS WITH YOU. SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF 598 | ALL NECESSARY SERVICING, REPAIR OR CORRECTION. 599 | 600 | 16. Limitation of Liability. 601 | 602 | IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING 603 | WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MODIFIES AND/OR CONVEYS 604 | THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY 605 | GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE 606 | USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS OF 607 | DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD 608 | PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS), 609 | EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF 610 | SUCH DAMAGES. 611 | 612 | 17. Interpretation of Sections 15 and 16. 613 | 614 | If the disclaimer of warranty and limitation of liability provided 615 | above cannot be given local legal effect according to their terms, 616 | reviewing courts shall apply local law that most closely approximates 617 | an absolute waiver of all civil liability in connection with the 618 | Program, unless a warranty or assumption of liability accompanies a 619 | copy of the Program in return for a fee. 620 | 621 | END OF TERMS AND CONDITIONS 622 | 623 | How to Apply These Terms to Your New Programs 624 | 625 | If you develop a new program, and you want it to be of the greatest 626 | possible use to the public, the best way to achieve this is to make it 627 | free software which everyone can redistribute and change under these terms. 628 | 629 | To do so, attach the following notices to the program. It is safest 630 | to attach them to the start of each source file to most effectively 631 | state the exclusion of warranty; and each file should have at least 632 | the "copyright" line and a pointer to where the full notice is found. 633 | 634 | {one line to give the program's name and a brief idea of what it does.} 635 | Copyright (C) {year} {name of author} 636 | 637 | This program is free software: you can redistribute it and/or modify 638 | it under the terms of the GNU General Public License as published by 639 | the Free Software Foundation, either version 3 of the License, or 640 | (at your option) any later version. 641 | 642 | This program is distributed in the hope that it will be useful, 643 | but WITHOUT ANY WARRANTY; without even the implied warranty of 644 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 645 | GNU General Public License for more details. 646 | 647 | You should have received a copy of the GNU General Public License 648 | along with this program. If not, see . 649 | 650 | Also add information on how to contact you by electronic and paper mail. 651 | 652 | If the program does terminal interaction, make it output a short 653 | notice like this when it starts in an interactive mode: 654 | 655 | {project} Copyright (C) {year} {fullname} 656 | This program comes with ABSOLUTELY NO WARRANTY; for details type `show w'. 657 | This is free software, and you are welcome to redistribute it 658 | under certain conditions; type `show c' for details. 659 | 660 | The hypothetical commands `show w' and `show c' should show the appropriate 661 | parts of the General Public License. Of course, your program's commands 662 | might be different; for a GUI interface, you would use an "about box". 663 | 664 | You should also get your employer (if you work as a programmer) or school, 665 | if any, to sign a "copyright disclaimer" for the program, if necessary. 666 | For more information on this, and how to apply and follow the GNU GPL, see 667 | . 668 | 669 | The GNU General Public License does not permit incorporating your program 670 | into proprietary programs. If your program is a subroutine library, you 671 | may consider it more useful to permit linking proprietary applications with 672 | the library. If this is what you want to do, use the GNU Lesser General 673 | Public License instead of this License. But first, please read 674 | . 675 | 676 | -------------------------------------------------------------------------------- /software/MANIFEST.in: -------------------------------------------------------------------------------- 1 | include poppy_ergo_jr/configuration/*.json 2 | include poppy_ergo_jr/vrep-scene/*.ttt 3 | include poppy_ergo_jr/poppy_ergo_jr.urdf 4 | -------------------------------------------------------------------------------- /software/README: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/poppy-project/poppy-ergo-jr/97ce599be8c717843c45ebf48341f2ebf8f250b3/software/README -------------------------------------------------------------------------------- /software/data/marker_112259237.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/poppy-project/poppy-ergo-jr/97ce599be8c717843c45ebf48341f2ebf8f250b3/software/data/marker_112259237.png -------------------------------------------------------------------------------- /software/data/marker_221052793.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/poppy-project/poppy-ergo-jr/97ce599be8c717843c45ebf48341f2ebf8f250b3/software/data/marker_221052793.png -------------------------------------------------------------------------------- /software/data/marker_44616414.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/poppy-project/poppy-ergo-jr/97ce599be8c717843c45ebf48341f2ebf8f250b3/software/data/marker_44616414.png -------------------------------------------------------------------------------- /software/poppy_ergo_jr/__init__.py: -------------------------------------------------------------------------------- 1 | from .poppy_ergo_jr import PoppyErgoJr 2 | 3 | from ._version import __version__ 4 | -------------------------------------------------------------------------------- /software/poppy_ergo_jr/_version.py: -------------------------------------------------------------------------------- 1 | __version__ = '4.0.2' 2 | -------------------------------------------------------------------------------- /software/poppy_ergo_jr/configuration/poppy_ergo_jr.json: -------------------------------------------------------------------------------- 1 | { 2 | "controllers": { 3 | "my_dxl_controller": { 4 | "sync_read": true, 5 | "protocol": 2, 6 | "attached_motors": [ 7 | "base", 8 | "tip" 9 | ], 10 | "port": "/dev/ttyAMA0", 11 | "syncloop": "LightDxlController" 12 | } 13 | }, 14 | "motorgroups": { 15 | "base": [ 16 | "m1", 17 | "m2", 18 | "m3" 19 | ], 20 | "tip": [ 21 | "m4", 22 | "m5", 23 | "m6" 24 | ] 25 | }, 26 | "motors": { 27 | "m1": { 28 | "offset": 0.0, 29 | "type": "XL-320", 30 | "id": 1, 31 | "angle_limit": [ 32 | -150.0, 33 | 150.0 34 | ], 35 | "orientation": "direct" 36 | }, 37 | "m2": { 38 | "offset": 0.0, 39 | "type": "XL-320", 40 | "id": 2, 41 | "angle_limit": [ 42 | -90.0, 43 | 125.0 44 | ], 45 | "orientation": "indirect" 46 | }, 47 | "m3": { 48 | "offset": 0.0, 49 | "type": "XL-320", 50 | "id": 3, 51 | "angle_limit": [ 52 | -90.0, 53 | 90.0 54 | ], 55 | "orientation": "indirect" 56 | }, 57 | "m4": { 58 | "offset": 0.0, 59 | "type": "XL-320", 60 | "id": 4, 61 | "angle_limit": [ 62 | -150.0, 63 | 150.0 64 | ], 65 | "orientation": "direct" 66 | }, 67 | "m5": { 68 | "offset": 0.0, 69 | "type": "XL-320", 70 | "id": 5, 71 | "angle_limit": [ 72 | -90.0, 73 | 90.0 74 | ], 75 | "orientation": "indirect" 76 | }, 77 | "m6": { 78 | "offset": 0.0, 79 | "type": "XL-320", 80 | "id": 6, 81 | "angle_limit": [ 82 | -110.0, 83 | 90.0 84 | ], 85 | "orientation": "indirect" 86 | } 87 | }, 88 | "sensors": { 89 | "camera": { 90 | "type": "OpenCVCamera", 91 | "index": -1, 92 | "fps": 20.0, 93 | "resolution": [640, 480] 94 | }, 95 | "marker_detector": { 96 | "type": "MarkerDetector", 97 | "cameras": ["camera"], 98 | "freq": 1.0, 99 | "need_robot": true 100 | } 101 | } 102 | } 103 | -------------------------------------------------------------------------------- /software/poppy_ergo_jr/poppy_ergo_jr.py: -------------------------------------------------------------------------------- 1 | from numpy import sum 2 | from functools import partial 3 | from time import sleep 4 | 5 | from pypot.creatures import AbstractPoppyCreature 6 | from pypot.creatures.ik import IKChain 7 | 8 | from .primitives.dance import Dance 9 | from .primitives.face_tracking import FaceTracking 10 | from .primitives.tracking_feedback import TrackingFeedback 11 | from .primitives.postures import (BasePosture, RestPosture, 12 | CuriousPosture, TetrisPosture, 13 | SafePowerUp) 14 | from .primitives.How_to_add_primitive_FR import (Tinsel, Tetu, Poule, Puzzel) 15 | 16 | 17 | class PoppyErgoJr(AbstractPoppyCreature): 18 | @classmethod 19 | def setup(cls, robot): 20 | robot._primitive_manager._filter = partial(sum, axis=0) 21 | 22 | c = IKChain.from_poppy_creature(robot, 23 | motors=robot.motors, 24 | passiv=[], 25 | tip=[0, 0, -0.07]) 26 | 27 | robot.chain = c 28 | 29 | robot.attach_primitive(SafePowerUp(robot), 'safe_power_up') 30 | 31 | robot.attach_primitive(Dance(robot), 'dance') 32 | 33 | robot.attach_primitive(BasePosture(robot, 2.), 'base_posture') 34 | robot.attach_primitive(RestPosture(robot, 2.), 'rest_posture') 35 | robot.attach_primitive(CuriousPosture(robot, 2.), 'curious_posture') 36 | robot.attach_primitive(TetrisPosture(robot, 2.), 'tetris_posture') 37 | 38 | robot.attach_primitive(Tinsel(robot), 'tinsel_demo') 39 | robot.attach_primitive(Tetu(robot), 'stubborn_demo') 40 | robot.attach_primitive(Poule(robot), 'chicken_demo') 41 | robot.attach_primitive(Puzzel(robot), 'puzzel_demo') 42 | 43 | if not robot.simulated and hasattr(robot, 'marker_detector'): 44 | robot.attach_primitive(TrackingFeedback(robot, 25.), 45 | 'tracking_feedback') 46 | 47 | for m in robot.motors: 48 | m.pid = (4, 2, 0) 49 | m.torque_limit = 70. 50 | m.led = 'off' 51 | 52 | if not robot.simulated and hasattr(robot, 'face_detector'): 53 | robot.attach_primitive(FaceTracking(robot, 10, 54 | robot.face_detector), 55 | 'face_detector') 56 | 57 | for m in robot.motors: 58 | m.led = 'green' 59 | sleep(0.2) 60 | m.led = 'off' 61 | -------------------------------------------------------------------------------- /software/poppy_ergo_jr/poppy_ergo_jr.urdf: -------------------------------------------------------------------------------- 1 | 3 | 5 | 6 | 9 | 11 | 18 | 19 | 20 | 23 | 24 | 26 | 27 | 29 | 31 | 32 | 33 | 34 | 37 | 38 | 40 | 41 | 42 | 43 | 45 | 46 | 49 | 51 | 58 | 59 | 60 | 63 | 64 | 66 | 67 | 69 | 71 | 72 | 73 | 74 | 77 | 78 | 80 | 81 | 82 | 83 | 86 | 89 | 91 | 93 | 95 | 96 | 98 | 99 | 102 | 104 | 111 | 112 | 113 | 116 | 117 | 119 | 120 | 122 | 124 | 125 | 126 | 127 | 130 | 131 | 133 | 134 | 135 | 136 | 139 | 142 | 144 | 146 | 148 | 149 | 151 | 152 | 155 | 157 | 164 | 165 | 166 | 169 | 170 | 172 | 173 | 175 | 177 | 178 | 179 | 180 | 183 | 184 | 186 | 187 | 188 | 189 | 192 | 195 | 197 | 199 | 201 | 202 | 204 | 205 | 208 | 210 | 217 | 218 | 219 | 222 | 223 | 225 | 226 | 228 | 230 | 231 | 232 | 233 | 236 | 237 | 239 | 240 | 241 | 242 | 245 | 248 | 250 | 252 | 254 | 255 | 257 | 258 | 261 | 263 | 270 | 271 | 272 | 275 | 276 | 278 | 279 | 281 | 283 | 284 | 285 | 286 | 289 | 290 | 292 | 293 | 294 | 295 | 298 | 301 | 303 | 305 | 307 | 308 | 310 | 311 | 314 | 316 | 323 | 324 | 325 | 328 | 329 | 331 | 332 | 334 | 336 | 337 | 338 | 339 | 342 | 343 | 345 | 346 | 347 | 348 | 351 | 354 | 356 | 358 | 360 | 361 | 362 | -------------------------------------------------------------------------------- /software/poppy_ergo_jr/primitives/How_to_add_primitive_FR.py: -------------------------------------------------------------------------------- 1 | # coding: utf-8 2 | __author__="thibault desprez" 3 | "thibault.desprez@gmail.com" 4 | ''' 5 | # Comment créer et manipuler les primitives de pypot pour les robots poppy ? 6 | 7 | ## Exemple appliquer : le mode demo du Poppy ErgoJr 8 | 9 | pré-requis: 10 | connaitre l'utiilsation de: 11 | my_robot.motors 12 | my_robot.mX.compliant 13 | my_robot.mX.goto_position 14 | my_robot.mX.led 15 | my_robot.mX.present_position 16 | my_robot.posture_is 17 | 18 | + avoir quelque notion des class et objet en python 19 | 20 | ''' 21 | ''' 22 | Tout d'abord quelque import 23 | ''' 24 | 25 | import time 26 | import random 27 | import cv2 28 | import numpy as np 29 | 30 | from pypot.primitive import Primitive, LoopPrimitive 31 | 32 | ''' 33 | On apprend dans le fichier ~/poppy_src/pypot/primitive/primitive.py que: 34 | - les primitives sont des 'objet' 35 | - qu'elle hérite leurs attribue, méthode et propriéte de la class Primitives 36 | - qu'il suiffit de compléter la fonction run() 37 | - que la commande pour lancer la primitive est: name_of_my_primitive.start() 38 | - que la commande pour lancer la primitive est: name_of_my_primitive.stop() 39 | - mais qu'il faut d'abord "l'attacher au robot" via la commande: my_robot.attach_primitive(MyPrimitive(self.robot), 'name_of_my_primitive') 40 | 41 | ## Exemple la primitives Tinsel (girlande): 42 | ''' 43 | 44 | 45 | class Tinsel(Primitive): #on crée un nouvelle class Tinsel qui hérite de la class Primitive 46 | ''' 47 | ici on veut que l'ergo glignote, qu'on puisse lui spécifier les couleurs et la vitesse (en Hz) 48 | 49 | - Toute les fonctions qui ne sont pas rédéfinit ici sont hérité de la class Primitive 50 | - La fonction __init__() est exécute des que la class est instancier 51 | - Ici nous souhaitons ajouter deux variables non définit dans la class Primitive: les couleurs et la vitesse 52 | ''' 53 | def __init__(self,robot,colors=['green','red','yellow','blue','pink','cyan','white','off'],freq=2): 54 | #on redéfinit la fonction __init__() hérité de Primitive, et lui ajoute deux parametre: colors et freq 55 | Primitive.__init__(self,robot) 56 | #on appel la fonction __init__() de la class Primitive (pour que les autres variables et parametre de celle-ci s'initie correctement) 57 | self.colors=colors 58 | self.freq=freq 59 | #on définit l'attribut self.colors et self.freq (qui peuvent être vue comme des variables) qui contiennent respectivement les couleurs spécifier dans le parametre colors et la vitesse spécifier dans le parametre freq passer lors l'instanciation de la primitive 60 | 61 | def run(self): 62 | #on définit la fonction run() 63 | while not self.should_stop(): 64 | #tant que l'on ne demande pas d'arréter la primitive 65 | for color in self.colors: 66 | #pour chacune des couleurs 67 | if not self.should_stop(): 68 | #si l'on ne demande pas d'arréter la primitives 69 | if self.should_pause(): self.wait_to_resume() 70 | #si on me demande pause, j'attend jusqu'a reprise 71 | for m in self.robot.motors: m.led = color 72 | #pour chaque moteurs, mettre la led en la couleur 73 | for i in range(5): 74 | if not self.should_stop(): 75 | if self.should_pause(): self.wait_to_resume() 76 | time.sleep((1./self.freq)/5) 77 | #je vérife dix foi par période si l'on ne demande pas d'arréter la primitives 78 | 79 | ''' 80 | ###Testons la primitives: 81 | ''' 82 | ''' 83 | from pypot.creatures import PoppyErgoJr 84 | poppy= PoppyErgoJr() 85 | poppy.attach_primitive(Tinsel(poppy,['yellow','white'],2), 'girlande') 86 | girlande.start() 87 | time.sleep(5) 88 | girlande.stop() 89 | ''' 90 | 91 | ''' 92 | ## Maintenant je souhaite créer plusieurs primitives qui ont des points commun. 93 | Je vais créer une class mère (héritant de primitive) qui contiendras ces points commun. 94 | 95 | dans le fichier ~/poppy_src/pypot/primitive/primitive.py , j'ai également appris que la class primitive exploiter la lib "thread". On apprend que chacune des primitives à un setup() (phase de lancement) un teardown() (phase d'extinction) et un run() 96 | 97 | ''' 98 | 99 | 100 | class BaseDemo(LoopPrimitive): 101 | #je définit ma class BaseDemo, fille de la class Primitive, et futur mère ;) 102 | def __init__(self, robot): 103 | #je définit ma fonction __init__() 104 | Primitive.__init__(self, robot) 105 | #j'apel la fonction __init__ de ma class mère 106 | 107 | self.defaut_posture = [0, -45, 25, 0, 45, -25] 108 | #je définit un nouveau attribue 109 | 110 | def posture_is(self, posture, error=2, motors='all'): 111 | if motors == 'all' : motors= self.robot.motors 112 | for i in range(len(motors)): 113 | if abs( motors[i].present_position - posture[i] ) > error : return False 114 | return True 115 | 116 | def distance_with(self, posture, motors='all'): 117 | #retourne une liste contenant la difference en degres (pour chaque moteur) entre la position actuelle du robot et une position donnee 118 | if motors == 'all': motors= self.robot.motors 119 | output= [ abs( motors[i].present_position - posture[i] ) for i in range(len(motors)) ] 120 | ''' 121 | autre ecriture: 122 | output=[] 123 | for i in range(len(motors)): 124 | output.append( abs( motors[i].present_position - posture[i] ) 125 | ''' 126 | return output 127 | 128 | def sleep_except_should_stop(self, time_seconde): 129 | for i in range (int(time_seconde*10)): 130 | if not self.should_stop(): time.sleep(time_seconde/(time_seconde*10)) 131 | #si l'on ne demande pas d'arréter la primitive, on attend 132 | 133 | def countdown(self, time_seconde): 134 | for i in range(int(time_seconde+time_seconde*0.2)): 135 | 136 | if not self.should_stop(): 137 | #si l'on ne demande pas d'arréter la primitive 138 | if self.should_pause(): self.wait_to_resume() 139 | #si on me demande pause, j'attend jusqu'a reprise 140 | 141 | for m in self.robot.motors: m.led="off" 142 | time.sleep( 0.5- (0.3/(time_seconde+time_seconde*0.2) *i )) 143 | for m in self.robot.motors: m.led="green" 144 | time.sleep(0.5) 145 | #je créer une sorte de compte a reboug lumineux 146 | 147 | def setup(self): 148 | #je définit la fonction setup() 149 | duration= int( max( self.distance_with( self.defaut_posture ) ) ) /100. 150 | #temps en fonction de la distance maximal actuel ; soit une distance max (thèorique) de 180° exécuter en un temps de 1,8 seconde ; connaissance ma position_défaut la distance max est 150° (avec m2) donnant un temps max de 1,5 secondes pour reprendre sa positon. on à donc le temps qui varie en fonction de la distance, c'est donc la vitesse qui est fixe. V=D/T ; 150/1,5=100 ; le moteur le plus éloigner de sa postion defaut se déplace à 100°/sec ; les autre moteurs ajuste leur vitesse (ralentissent) pour arriver à leur position defaut en même temps que le moteur le plus éloigné. 151 | for m in self.robot.motors: 152 | m.compliant=False 153 | m.goto_position( self.defaut_posture[m.id-1] , duration ) 154 | time.sleep( duration + 0.2 ) 155 | #déplacer les moteurs vers leur position defaut (définit dans self.__init__) 156 | for m in self.robot.motors: 157 | m.compliant=True 158 | m.led='off' 159 | time.sleep(0.1) 160 | #mettre tout les moteurs en "souple" et éteindre les led 161 | 162 | def run(self): 163 | pass 164 | #je ne définit pas de fonction run() ; elle sera définit dans mes class filles 165 | 166 | def teardown(self): 167 | #je définit la fonction teardown() 168 | BaseDemo.setup(self) 169 | #j'appel BaseDemo.setup() : le robot éffectue la même action qu'au démarage 170 | 171 | 172 | ''' 173 | ### Maintenant je vais créer une nouvelle primitive qui héritera de la class BaseDemo et de la class Primitive. 174 | ''' 175 | 176 | 177 | class Tetu(BaseDemo, Primitive): 178 | ''' 179 | Ici, je veux créer un comportemant "de type tétu" autrement dit, quelqu'un qui revient toujours sur ses potitions. Le comportement est définit comme suit: 180 | - si je suis dans ma position de départ, je me met en vert et attend 181 | - si je ne suis plus dans ma position de départ, je devient rouge et reprend ma position 182 | 183 | Quelque subtilité, sont ajouter ensuite pour affiner le comportement 184 | ''' 185 | 186 | #je n'est pas besoin de définir d'autre chose durant initialisation, je ne définit pas la fonction __init__() 187 | #la fonction BaseDemo.__init__() sera la fonction exécuté par défaut 188 | 189 | def setup(self): 190 | #je définit la fonction setup() 191 | BaseDemo.setup(self) 192 | #j'apel la fonction setup() de ma class mère 193 | 194 | sleep=5 195 | for i in range(int(sleep+(sleep/5))): 196 | 197 | if not self.should_stop(): 198 | #si l'on ne demande pas d'arréter la primitive 199 | if self.should_pause(): self.wait_to_resume() 200 | #si on me demande pause, j'attend jusqu'a reprise 201 | for m in self.robot.motors: m.led="off" 202 | time.sleep(0.5-((0.5/sleep)*i)) 203 | for m in self.robot.motors: m.led="green" 204 | time.sleep(0.5) 205 | #je créer une sorte de compte a reboug lumineux 206 | 207 | self.start_pos= [round(m.present_position) for m in self.robot.motors] 208 | #je sauvegarde la position de départ choisie. 209 | 210 | def run(self): 211 | #on définit la fonction run 212 | while not self.should_stop(): 213 | #si l'on ne demande pas d'arréter la primitive 214 | if self.should_pause(): self.wait_to_resume() 215 | #si on me demande pause, j'attend jusqu'a reprise 216 | 217 | if not (self.posture_is(self.start_pos,6)) : 218 | #si ma position n'est pas ma position de départ 219 | 220 | for m in self.robot.motors: m.led = 'yellow' 221 | #je deviens jaune 222 | 223 | for t in range(10): 224 | if not self.should_stop(): 225 | if self.should_pause(): self.wait_to_resume() 226 | time.sleep(0.1) 227 | #j'attend 1 secondes sauf si l'on ne demande pas d'arréter la primitive 228 | 229 | t=0 230 | while self.posture_is(self.start_pos,45) and t<200 and not(self.should_stop()): 231 | if self.should_pause(): self.wait_to_resume() 232 | time.sleep(0.01) 233 | t+=1 234 | #tant que ma position n'est pas trop éloigner de ma position de départ, et qu'il s'est écoulé moins de 2 secondes, et que l'on ne demande pas d'arréter la primitive (ou de mettre en pause) ; j'attend 235 | 236 | if not self.should_stop(): 237 | #si l'on ne demande pas d'arréter la primitive 238 | if self.should_pause(): self.wait_to_resume() 239 | #si on me demande pause, j'attend jusqu'a reprise 240 | 241 | if not (self.posture_is(self.start_pos,6)): 242 | #si on ne ma pas remis dans la bonne position alors... 243 | 244 | for m in self.robot.motors: 245 | m.led = 'red' 246 | m.compliant=False 247 | m.goto_position(self.start_pos[m.id-1],0.5) 248 | #...je reprend ma postion de départ en mallumant en rouge et... 249 | 250 | for t in range(15): 251 | if not self.should_stop(): 252 | if self.should_pause(): self.wait_to_resume() 253 | time.sleep(0.1) 254 | #... j'attend 1,5 secondes sauf si l'on ne demande pas d'arréter la primitive, puis... 255 | 256 | for m in self.robot.motors: 257 | m.led = 'green' 258 | m.compliant=True 259 | #...je redeviens vert et manipulable. 260 | 261 | time.sleep(0.01) 262 | #je vérifie tout les 0.01 seconde si j'ai bouger 263 | 264 | ''' 265 | ### Maintenant je vais créer une nouvelle primitive qui héritera de la class BaseDemo et de la class Primitive. 266 | ''' 267 | 268 | class Poule(BaseDemo, Primitive): 269 | 270 | def test(self): 271 | return "ok" 272 | 273 | def setup(self): 274 | BaseDemo.setup(self) 275 | 276 | self.latence=0.5 277 | self.local_time=0 278 | for m in self.robot.tip: 279 | m.led='red' 280 | m.compliant=False 281 | for m in self.robot.base: 282 | m.led='green' 283 | m.compliant=True 284 | 285 | def run(self): 286 | while not self.should_stop(): 287 | if self.should_pause(): self.wait_to_resume() 288 | 289 | #self.local_time=time.time() 290 | #for i in range(3): self.robot.motors[i+3].goto_position(-(self.robot.motors[i].present_position),self.latence) 291 | for i in range(3): self.robot.motors[i+3].goto_position(-(self.robot.motors[i].present_position),0) 292 | #self.latence= ( ( (time.time()-self.local_time) +0.001 ) + self.latence )/2. 293 | #self.latence= ( (time.time()-self.local_time) + self.latence )/2. 294 | time.sleep(0.01) 295 | 296 | ''' 297 | d'autre exemples 298 | ''' 299 | 300 | class PouleInv(BaseDemo, Primitive): 301 | 302 | def setup(self): 303 | BaseDemo.setup(self) 304 | 305 | self.latence=0.5 306 | self.local_time=0 307 | for m in self.robot.base: 308 | m.led='red' 309 | m.compliant=False 310 | for m in self.robot.tip: 311 | m.led='green' 312 | m.compliant=True 313 | 314 | def run(self): 315 | while not self.should_stop(): 316 | if self.should_pause(): self.wait_to_resume() 317 | 318 | self.local_time=time.time() 319 | for i in range(3): self.robot.motors[i].goto_position(-(self.robot.motors[i+3].present_position),self.latence) 320 | #self.latence= ( ( (time.time()-self.local_time) +0.001 ) + self.latence )/2. 321 | self.latence= ( (time.time()-self.local_time) + self.latence )/2. 322 | time.sleep(0.001) 323 | 324 | ''' 325 | ### Maintenant nous parler du "primitive_manager" 326 | lorsque plusieurs primitives s'éxécute en même temps, il combine les différent input pour produire un unique output vers le robot. 327 | un certaine ordre héracchique est produit lorsque que l'on appelle une primitive depuis une primitive: 328 | ici, nous allons utilise les primitives MoveRecorder et MovePlayer. Lors de leur utilisation il faudras déangager notre primitive du "primitive_manager" au profit des primitives MoveRecorder et MovePlayer. 329 | ''' 330 | from pypot.primitive.move import MoveRecorder 331 | from pypot.primitive.move import MovePlayer 332 | 333 | class ProgByDemo(BaseDemo, Primitive): 334 | 335 | def __init__(self, robot, record_time=10): 336 | BaseDemo.__init__(self, robot) 337 | self.robot.attach_primitive(Tinsel(self.robot), 'tinsel') 338 | self.record_time=record_time # en seconde 339 | 340 | def run(self): 341 | while not self.should_stop(): 342 | if self.should_pause(): self.wait_to_resume() 343 | 344 | while not(self.posture_is(self.defaut_posture)): time.sleep(0.1) 345 | for m in self.robot.motors: 346 | m.led="green" 347 | m.compliant=True 348 | 349 | my_record = MoveRecorder(self.robot, 50, self.robot.motors) 350 | my_record.start() 351 | 352 | sleep = int(self.record_time+(self.record_time/5.)) 353 | for i in range(sleep): 354 | if not self.should_stop(): 355 | if self.should_pause(): self.wait_to_resume() 356 | for m in self.robot.motors: m.led="green" 357 | time.sleep(0.5) 358 | for m in self.robot.motors: m.led="off" 359 | time.sleep(0.5-((0.5/sleep)*i)) 360 | 361 | my_record.stop() 362 | #my_record.wait_to_stop() 363 | 364 | if not self.should_stop(): 365 | if self.should_pause(): self.wait_to_resume() 366 | 367 | self.robot.tinsel.colors=['red'] 368 | self.robot.tinsel.freq=1 369 | self.robot.tinsel.start() 370 | 371 | self.robot._primitive_manager.remove(self) 372 | # patch pour passer des fake moteurs de la primitive ProgByDemo aux moteurs reel de l ergo 373 | 374 | my_play = MovePlayer(self.robot, my_record.move) 375 | my_play.start() 376 | 377 | for t in range(self.record_time*2): 378 | if not self.should_stop(): 379 | if self.should_pause(): self.wait_to_resume() 380 | time.sleep(0.5) 381 | 382 | if my_play.is_alive(): my_play.stop() 383 | 384 | self.robot.tinsel.stop() 385 | 386 | self.robot._primitive_manager.add(self) # on redonne le control des moteurs a la primitive ProgByDemo 387 | 388 | duration= int( max( self.distance_with( self.defaut_posture ) ) )/100. 389 | for m in self.robot.motors: 390 | m.compliant=False 391 | m.goto_position(self.defaut_posture[m.id-1],duration) 392 | time.sleep(duration) 393 | 394 | ''' 395 | ### Maintenant parlons jeux 396 | Nous allons créer des méthode suplémentaire pour facilité l'interaction 397 | Ici, nous fabriquon une sorte de Puzzel 398 | ''' 399 | 400 | class Puzzel(BaseDemo, Primitive): 401 | 402 | methods = ['start', 'stop', 'pause', 'resume', 403 | 'level_veryeasy', 'level_easy','level_noramle','level_hard','level_veryhard','level_growing', 404 | 'precision_easy','precision_normal','precision_hard'] 405 | 406 | def __init__(self, robot, level=0, precision=20): 407 | BaseDemo.__init__(self, robot) 408 | self.level=level 409 | self.precision=precision 410 | self.set_manual=False 411 | self.fig=[] 412 | 413 | 414 | def level_growing(self): 415 | self.set_manual=False 416 | self.level=0 417 | def level_veryeasy(self): 418 | self.set_manual=True 419 | self.level=1 420 | def level_easy(self): 421 | self.set_manual=True 422 | self.level=2 423 | def level_normal(self): 424 | self.set_manual=True 425 | self.level=3 426 | def level_hard(self): 427 | self.set_manual=True 428 | self.level=4 429 | def level_veryhard(self): 430 | self.set_manual=True 431 | self.level=5 432 | 433 | def precision_easy(self): self.precision=20 434 | def precision_normal(self): self.precision=10 435 | def precision_hard(self): self.precision=5 436 | 437 | def new_fig(self,level=0): 438 | var=[-75, -45, 0, 0, 45, 75] 439 | m1=m4=m6=0 440 | fig=[ 441 | [m1, 0, -90, m4, 45, m6], 442 | [m1, 0, 90, m4, -45, m6], 443 | [m1, 0, 0, m4, -90, m6], 444 | [m1, 0, 0, m4, 90, m6], 445 | [m1, 45, -90, m4, 0, m6], 446 | [m1, 45, -90, m4, 90, m6], 447 | [m1, -45, 90, m4, 0, m6], 448 | [m1, -45, 90, m4, -90, m6]] 449 | 450 | if level==0: 451 | fig=fig[0] 452 | elif level==1: 453 | fig=fig[0] 454 | m = random.sample(var,1)[0] 455 | fig[0]=m 456 | fig[3]=m 457 | fig[5]=m 458 | elif level==2: 459 | fig=random.sample(fig,1)[0] 460 | m = random.sample(var,1)[0] 461 | fig[0]=m 462 | fig[3]=m 463 | fig[5]=m 464 | elif level==3: 465 | fig=random.sample(fig,1)[0] 466 | m = random.sample(var,2) 467 | fig[0]=m[0] 468 | fig[3]=m[1] 469 | fig[5]=m[0] 470 | elif level==4: 471 | fig=random.sample(fig,1)[0] 472 | m = random.sample(var,3) 473 | fig[0]=m[0] 474 | fig[3]=m[1] 475 | fig[5]=m[2] 476 | else: 477 | fig=random.sample(fig,1)[0] 478 | m = [ random.randrange(-75,75) for i in range(3) ] 479 | fig[0]=m[0] 480 | fig[3]=m[1] 481 | fig[5]=m[2] 482 | return fig 483 | 484 | def run(self): 485 | while not self.should_stop(): 486 | if self.should_pause(): self.wait_to_resume() 487 | 488 | if self.set_manual==True: self.fig.append(self.new_fig(self.level)) 489 | else: self.fig.append(self.new_fig(len(self.fig))) 490 | 491 | duration= int( max( self.distance_with( self.fig[-1] ) ) )/100. 492 | for m in self.robot.motors: 493 | m.led='red' 494 | m.compliant=False 495 | m.goto_position(self.fig[-1][m.id-1],duration) 496 | 497 | for i in range(10): #time to show 5sec 498 | if not self.should_stop(): 499 | if self.should_pause(): self.wait_to_resume() 500 | time.sleep(0.5) 501 | 502 | for m in self.robot.motors: m.goto_position(self.defaut_posture[m.id-1],1) 503 | while not(self.posture_is(self.defaut_posture)): time.sleep(0.1) 504 | 505 | for m in self.robot.motors: 506 | m.compliant=True 507 | m.led='green' 508 | 509 | time_search=10 510 | sleep = int(time_search+(time_search/5.)) 511 | for i in range(sleep): 512 | if not self.should_stop(): 513 | if self.should_pause(): self.wait_to_resume() 514 | for m in self.robot.motors: m.led="green" 515 | time.sleep(0.5) 516 | for m in self.robot.motors: m.led="off" 517 | time.sleep(0.5-((0.5/sleep)*i)) 518 | 519 | if not self.should_stop(): 520 | if self.should_pause(): self.wait_to_resume() 521 | 522 | if self.posture_is(self.fig[-1],self.precision): 523 | for m in self.robot.motors: m.led='green' 524 | time.sleep(0.5) 525 | for m in self.robot.motors: m.led='off' 526 | for i in range(len(self.fig)): 527 | self.robot.motors[i].led='green' 528 | time.sleep(0.25) 529 | else: 530 | for m in self.robot.motors: 531 | m.led='red' 532 | m.compliant=False 533 | m.goto_position(self.fig[-1][m.id-1],1) 534 | for i in range(4): #time to show 2sec 535 | if not self.should_stop(): 536 | if self.should_pause(): self.wait_to_resume() 537 | time.sleep(0.5) 538 | self.fig=[] 539 | 540 | if len(self.fig)==6: 541 | for m in self.robot.motors: m.led='off' 542 | for i in range(len(self.fig)): 543 | if not self.should_stop(): 544 | if self.should_pause(): self.wait_to_resume() 545 | duration= int( max( self.distance_with( self.fig[i] ) ) )/100. 546 | for m in self.robot.motors: 547 | m.compliant=False 548 | m.goto_position(self.fig[i][m.id-1],duration) 549 | for l in range(i): self.robot.motors[i].led='green' 550 | time.sleep(duration) 551 | 552 | self.robot._primitive_manager.remove(self) 553 | # patch pour passer des fake moteurs de la primitive ProgByDemo aux moteurs reel de l ergo 554 | self.robot.dance.start() 555 | 556 | for i in range(10): #time to dance 5sec 557 | if not self.should_stop(): 558 | if self.should_pause(): self.wait_to_resume() 559 | time.sleep(0.5) 560 | self.robot.dance.stop() 561 | self.robot.dance.wait_to_stop() 562 | 563 | self.robot._primitive_manager.add(self) 564 | # patch pour passer des fake moteurs de la primitive ProgByDemo aux moteurs reel de l ergo 565 | self.fig=[] 566 | 567 | for m in self.robot.motors: 568 | m.compliant=False 569 | m.led='off' 570 | m.goto_position(self.defaut_posture[m.id-1],1) 571 | while not(self.posture_is(self.defaut_posture)): time.sleep(0.1) 572 | 573 | ''' 574 | Enfin, regroupons notre travail 575 | ''' 576 | 577 | class Demos(BaseDemo, Primitive): 578 | methods = ['start', 'stop', 'pause', 'resume', 'press_button'] 579 | def __init__(self, robot): 580 | BaseDemo.__init__(self, robot) 581 | 582 | self.robot.attach_primitive(Tetu(self.robot), 'tetu') 583 | self.robot.attach_primitive(Poule(self.robot), 'poule') 584 | self.robot.attach_primitive(PouleInv(self.robot), 'poule_inv') 585 | self.robot.attach_primitive(ProgByDemo(self.robot), 'prog_by_demo') 586 | self.robot.attach_primitive(Puzzel(self.robot), 'puzzel') 587 | 588 | self.robot.attach_primitive(Tournesol(self.robot), 'tournesol') 589 | 590 | self.match={'white':self.robot.tetu, 591 | 'blue':self.robot.poule, 592 | 'cyan':self.robot.poule_inv, # a remplacer par tracking octave 593 | 'yellow':self.robot.puzzel, # a remplacer par tournesol 594 | 'pink':self.robot.prog_by_demo 595 | } 596 | """ 597 | prefer use: 598 | red color for not_compliant_motors 599 | green color for compliant_motors 600 | """ 601 | self.robot.attach_primitive(Tinsel(self.robot), 'tinsel') 602 | self.robot.tinsel.colors= [key for key in self.match.keys()] 603 | random.shuffle(self.robot.tinsel.colors) 604 | self.robot.tinsel.freq= 1 605 | 606 | self.button=0 607 | 608 | def press_button(self): 609 | self.button+=1 610 | return 'have press '+str(self.button)+'x' 611 | 612 | def reset_button(self): 613 | self.button=0 614 | return 'reset button' 615 | 616 | def run(self): 617 | while not self.should_stop(): 618 | if self.should_pause(): self.wait_to_resume() 619 | 620 | old_b_val=self.button 621 | self.robot.tinsel.colors= [key for key in self.match.keys()] 622 | random.shuffle(self.robot.tinsel.colors) 623 | self.robot.tinsel.freq= 1 624 | 625 | self.robot.tinsel.start() 626 | while self.button==old_b_val and not self.should_stop(): 627 | if self.should_pause(): self.wait_to_resume() 628 | time.sleep(0.01) 629 | 630 | color=self.robot.motors[0].led 631 | self.robot.tinsel.stop() 632 | 633 | old_b_val=self.button 634 | if not self.should_stop(): 635 | 636 | self.robot._primitive_manager.remove(self) 637 | 638 | self.match[color].start() 639 | while self.button==old_b_val and not self.should_stop(): 640 | if self.should_pause(): self.wait_to_resume() 641 | time.sleep(0.01) 642 | self.match[color].stop() 643 | 644 | self.robot._primitive_manager.add(self) 645 | 646 | 647 | ''' 648 | ADD demo tournesol 649 | ''' 650 | class Tournesol(BaseDemo, Primitive): 651 | ''' 652 | Ici, je veux créer un comportemant "de type ... 653 | ''' 654 | #je n'est pas besoin de définir d'autre chose durant initialisation, je ne définit pas la fonction __init__() 655 | #la fonction BaseDemo.__init__() sera la fonction exécuté par défaut 656 | 657 | def setup(self): 658 | #je définit la fonction setup() 659 | BaseDemo.setup(self) 660 | #j'apel la fonction setup() de ma class mère 661 | for m in self.robot.motors: 662 | m.led='white' 663 | m.compliant=False 664 | self.robot.m1.goto_position(0,1) 665 | self.robot.m4.goto_position(0,1) 666 | 667 | def run(self): 668 | #on définit la fonction run 669 | while not self.should_stop(): 670 | #si l'on ne demande pas d'arréter la primitive 671 | if self.should_pause(): self.wait_to_resume() 672 | #si on me demande pause, j'attend jusqu'a reprise 673 | 674 | for i in range(5): 675 | alpha=[] 676 | img = self.robot.camera.frame 677 | gray = cv2.cvtColor(img, cv2.COLOR_BGR2GRAY) 678 | hist = cv2.calcHist([gray],[0],None,[256],[0,256]) 679 | #lum.append(((sum(hist[90:150])/10000))) 680 | #plt.hist(gray.ravel(),256,[0,256]) 681 | #plt.title('Histogram for gray scale picture') 682 | #plt.show() 683 | alpha.append((sum([np.percentile(hist,i)/1000 for i in range(90,100)])-30)/55) 684 | time.sleep(0.1) 685 | 686 | alpha= np.mean(alpha) 687 | self.robot.m2.goto_position(-5-alpha*10,0.5) 688 | self.robot.m3.goto_position(-45+alpha*20,0.5) 689 | self.robot.m5.goto_position(0+alpha*90,0.5) 690 | self.robot.m6.goto_position(-45+alpha*80,0.5) 691 | 692 | alpha=int(alpha*4) 693 | if alpha == 4: 694 | for m in self.robot.motors: m.led='white' 695 | else: 696 | for m in self.robot.motors[:3]: m.led='green' 697 | if alpha == 3: 698 | for m in self.robot.motors[3:]: m.led='green' 699 | elif alpha == 2: 700 | for m in self.robot.motors[3:]: m.led='yellow' 701 | elif alpha == 1: 702 | for m in self.robot.motors[4:]: m.led='pink' 703 | self.robot.m4.led='yellow' 704 | elif alpha == 0: 705 | self.robot.m4.led='yellow' 706 | self.robot.m5.led='pink' 707 | self.robot.m6.led='red' 708 | -------------------------------------------------------------------------------- /software/poppy_ergo_jr/primitives/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/poppy-project/poppy-ergo-jr/97ce599be8c717843c45ebf48341f2ebf8f250b3/software/poppy_ergo_jr/primitives/__init__.py -------------------------------------------------------------------------------- /software/poppy_ergo_jr/primitives/dance.py: -------------------------------------------------------------------------------- 1 | from pypot.primitive import LoopPrimitive 2 | from pypot.primitive.utils import Sinus 3 | 4 | 5 | class Dance(LoopPrimitive): 6 | def __init__(self, robot): 7 | LoopPrimitive.__init__(self, robot, 1.) 8 | 9 | def setup(self): 10 | for m in self.robot.motors: 11 | m.compliant = False 12 | 13 | self.sinus = [ 14 | Sinus(self.robot, 25., [self.robot.m1], amp=90., freq=0.25), 15 | Sinus(self.robot, 25., [self.robot.m4], amp=90., freq=0.25, phase=180.), 16 | 17 | Sinus(self.robot, 25., [self.robot.m5], amp=30, freq=.8), 18 | Sinus(self.robot, 25., [self.robot.m6], amp=30, freq=.8, phase=180), 19 | 20 | Sinus(self.robot, 25., self.robot.motors, amp=10, freq=.1) 21 | ] 22 | 23 | init_pos = dict([(m.name, 0.0) for m in self.robot.motors]) 24 | self.robot.goto_position(init_pos, 3., wait=True) 25 | 26 | for m in self.robot.motors: 27 | m.moving_speed = 150. 28 | 29 | for m in self.robot.motors: 30 | m.led = 'green' 31 | 32 | [s.start() for s in self.sinus] 33 | 34 | def update(self): 35 | pass 36 | 37 | def teardown(self): 38 | [s.stop() for s in self.sinus] 39 | 40 | for m in self.robot.motors: 41 | m.led = 'off' 42 | -------------------------------------------------------------------------------- /software/poppy_ergo_jr/primitives/face_tracking.py: -------------------------------------------------------------------------------- 1 | from pypot.primitive import LoopPrimitive 2 | 3 | 4 | class FaceTracking(LoopPrimitive): 5 | def __init__(self, robot, freq, face_detector): 6 | LoopPrimitive.__init__(self, robot, freq) 7 | 8 | self.face_detector = face_detector 9 | 10 | self.dx, self.dy = 60, 50 11 | self._tracked_face = None 12 | 13 | def setup(self): 14 | self.robot.rest_posture.start() 15 | self.robot.rest_posture.wait_to_stop() 16 | 17 | for m in self.robot._robot.motors: 18 | m.led = 'yellow' 19 | 20 | self.rest_pos = {m.name: m.present_position for m in self.robot.motors} 21 | for m in [self.robot.m1, self.robot.m5]: 22 | m.moving_speed = 50. 23 | 24 | # TODO: That's a really nasty way to circumvent prim sandboxing 25 | # How should we do that in a more elegant way? 26 | img = getattr(self.face_detector._robot, 27 | self.face_detector._names[0]).frame 28 | self.img_size = tuple(reversed(img.shape[:2])) 29 | 30 | def update(self): 31 | faces = self.face_detector.faces 32 | 33 | # use filter to keep only closest faces to preivoulsy tracked one 34 | 35 | if faces: 36 | x, y = faces[0].center 37 | x = (float(x) / self.img_size[0]) * 2 - 1 38 | y = (float(y) / self.img_size[1]) * 2 - 1 39 | 40 | self.robot.m1.goal_position = self.rest_pos['m1'] -x * self.dx 41 | self.robot.m5.goal_position = self.rest_pos['m5'] + y * self.dy 42 | 43 | def teardown(self): 44 | for m in self.robot._robot.motors: 45 | m.led = 'off' 46 | -------------------------------------------------------------------------------- /software/poppy_ergo_jr/primitives/headfollow.py: -------------------------------------------------------------------------------- 1 | from pypot.primitive import LoopPrimitive 2 | 3 | 4 | class HeadFollow(LoopPrimitive): 5 | def __init__(self, robot, freq, detector, tracked_id): 6 | LoopPrimitive.__init__(self, robot, freq) 7 | 8 | self.dx, self.dy = 60, 50 9 | 10 | def get_marker_pos(): 11 | marker = [m.position for m in getattr(detector, 'markers') 12 | if m.id == tracked_id] 13 | 14 | if len(marker) == 1: 15 | return marker[0] 16 | 17 | return None 18 | 19 | self.get_marker_pos = get_marker_pos 20 | 21 | def setup(self): 22 | self.robot.rest_posture.start() 23 | self.robot.rest_posture.wait_to_stop() 24 | 25 | self.rest_pos = {m.name: m.present_position for m in self.robot.motors} 26 | for m in [self.robot.m1, self.robot.m2]: 27 | m.moving_speed = 50. 28 | 29 | def update(self): 30 | c = self.get_marker_pos() 31 | 32 | if c is not None: 33 | x, y = c 34 | 35 | self.robot.m1.goal_position = self.rest_pos['m1'] - x * self.dx 36 | self.robot.m2.goal_position = self.rest_pos['m2'] + y * self.dy 37 | 38 | def teardown(self): 39 | self.robot.rest_posture.start() 40 | self.robot.rest_posture.wait_to_stop() 41 | -------------------------------------------------------------------------------- /software/poppy_ergo_jr/primitives/jump.py: -------------------------------------------------------------------------------- 1 | import time 2 | 3 | from pypot.primitive import Primitive 4 | 5 | 6 | class Jump(Primitive): 7 | def setup(self): 8 | self.up = {'m1': 0, 'm2': -10, 'm3': -20, 'm4': 0, 'm5': -35, 'm6': -35} 9 | self.down = {'m1': 0, 'm2': -75, 'm3': 55, 'm4': 0, 'm5': 35, 'm6': 35} 10 | 11 | for m in self.robot.motors: 12 | m.compliant = False 13 | m.pid = (10., 0., 0.) 14 | m.moving_speed = 0. 15 | 16 | def run(self): 17 | while not self.should_stop(): 18 | if self.should_pause(): 19 | self.wait_to_resume() 20 | 21 | for name, p in self.up.items(): 22 | m = getattr(self.robot, name) 23 | m.moving_speed = 0 24 | m.goal_position = p 25 | time.sleep(.2) 26 | 27 | for name, p in self.down.items(): 28 | m = getattr(self.robot, name) 29 | m.moving_speed = 250. 30 | m.goal_position = p 31 | time.sleep(.4) 32 | 33 | def teardown(self): 34 | for m in self.robot.motors: 35 | m.pid = (4., 0., 0.) 36 | -------------------------------------------------------------------------------- /software/poppy_ergo_jr/primitives/postures.py: -------------------------------------------------------------------------------- 1 | from pypot.primitive import Primitive, LoopPrimitive 2 | from pypot.primitive.utils import SimplePosture, Sinus 3 | 4 | 5 | class BasePosture(SimplePosture): 6 | @property 7 | def target_position(self): 8 | return {m.name: 0. for m in self.robot.motors} 9 | 10 | 11 | class RestPosture(SimplePosture): 12 | @property 13 | def leds(self): 14 | return {m: 'blue' for m in self.robot.motors} 15 | 16 | @property 17 | def target_position(self): 18 | return { 19 | 'm1': 0., 20 | 'm2': -90., 21 | 'm3': 35., 22 | 'm4': 0., 23 | 'm5': 55., 24 | 'm6': -5., 25 | } 26 | 27 | class CuriousPosture(SimplePosture): 28 | @property 29 | def target_position(self): 30 | return { 31 | 'm1': 0., 32 | 'm2': -15., 33 | 'm3': 40., 34 | 'm4': 0., 35 | 'm5': -35., 36 | 'm6': -60. 37 | } 38 | 39 | @property 40 | def leds(self): 41 | return {m: 'pink' for m in self.robot.motors} 42 | 43 | class TetrisPosture(SimplePosture): 44 | @property 45 | def target_position(self): 46 | return { 47 | 'm1': 0., 48 | 'm2': -90., 49 | 'm3': 90., 50 | 'm4': 0., 51 | 'm5': -90., 52 | 'm6': -90. 53 | } 54 | 55 | @property 56 | def leds(self): 57 | return {m: 'yellow' for m in self.robot.motors} 58 | 59 | class IdlePosture(SimplePosture): 60 | @property 61 | def target_position(self): 62 | return { 63 | 'm1': 0.0, 64 | 'm2': -110., 65 | 'm3': 65.0, 66 | 'm4': 0.0, 67 | 'm5': 34.0, 68 | 'm6': 20.0, 69 | } 70 | 71 | @property 72 | def leds(self): 73 | return {m: 'blue' for m in self.robot.motors} 74 | 75 | class IdleBreathing(LoopPrimitive): 76 | def setup(self): 77 | self.idle = IdlePosture(self.robot, 1.0) 78 | self.idle.start() 79 | self.idle.wait_to_stop() 80 | 81 | self.sinus = [ 82 | Sinus(self.robot, 10., [self.robot.m3, ], amp=5, freq=.1, 83 | offset=self.robot.m3.present_position), 84 | Sinus(self.robot, 10., [self.robot.m5], amp=10, freq=.1, 85 | offset=self.robot.m5.present_position, phase=3.14), 86 | ] 87 | import time 88 | time.sleep(2) 89 | [s.start() for s in self.sinus] 90 | 91 | for m in self.robot.motors: 92 | m.led = 'blue' 93 | 94 | def update(self): 95 | pass 96 | 97 | def teardown(self): 98 | for m in self.robot.motors: 99 | m.led = 'off' 100 | [s.stop() for s in self.sinus] 101 | 102 | self.idle.start() 103 | self.idle.wait_to_stop() 104 | 105 | 106 | class SafePowerUp(Primitive): 107 | def run(self): 108 | idle_prim = IdlePosture(self.robot, 3.0) 109 | idle_prim.start() 110 | idle_prim.wait_to_stop() 111 | 112 | def teardown(self): 113 | for m in self.robot.motors: 114 | m.moving_speed = 0. 115 | -------------------------------------------------------------------------------- /software/poppy_ergo_jr/primitives/tracking_feedback.py: -------------------------------------------------------------------------------- 1 | from collections import deque 2 | 3 | from pypot.primitive import LoopPrimitive 4 | 5 | 6 | class TrackingFeedback(LoopPrimitive): 7 | def setup(self): 8 | self._old = False 9 | 10 | def update(self): 11 | if not hasattr(self, 'q'): 12 | self.q = deque([], 6) 13 | 14 | self.q.append(len(self.robot.marker_detector.markers) > 0) 15 | tracking = any(self.q) 16 | 17 | if tracking != self._old: 18 | for m in self.robot.tip: 19 | self.affect_once(m, 'led', 'green' if tracking else 'off') 20 | 21 | self._old = tracking 22 | 23 | def teardown(self): 24 | for m in self.robot.motors: 25 | m.led = 'off' 26 | -------------------------------------------------------------------------------- /software/poppy_ergo_jr/vrep-scene/poppy_ergo_jr.ttt: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/poppy-project/poppy-ergo-jr/97ce599be8c717843c45ebf48341f2ebf8f250b3/software/poppy_ergo_jr/vrep-scene/poppy_ergo_jr.ttt -------------------------------------------------------------------------------- /software/poppy_ergo_jr/vrep-scene/poppy_ergo_jr_empty.ttt: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/poppy-project/poppy-ergo-jr/97ce599be8c717843c45ebf48341f2ebf8f250b3/software/poppy_ergo_jr/vrep-scene/poppy_ergo_jr_empty.ttt -------------------------------------------------------------------------------- /software/poppy_ergo_jr/vrep-scene/poppy_ergo_jr_holder.ttt: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/poppy-project/poppy-ergo-jr/97ce599be8c717843c45ebf48341f2ebf8f250b3/software/poppy_ergo_jr/vrep-scene/poppy_ergo_jr_holder.ttt -------------------------------------------------------------------------------- /software/poppy_ergo_jr/vrep-scene/timer.lua: -------------------------------------------------------------------------------- 1 | -- DO NOT WRITE CODE OUTSIDE OF THE if-then-end SECTIONS BELOW!! 2 | 3 | if (sim_call_type==sim_childscriptcall_initialization) then 4 | simSetScriptAttribute(sim_handle_self,sim_childscriptattribute_automaticcascadingcalls,false) 5 | end 6 | 7 | 8 | if (sim_call_type==sim_childscriptcall_actuation) then 9 | if not firstTimeHere93846738 then 10 | firstTimeHere93846738=0 11 | end 12 | simSetScriptAttribute(sim_handle_self,sim_scriptattribute_executioncount,firstTimeHere93846738) 13 | firstTimeHere93846738=firstTimeHere93846738+1 14 | 15 | ------------------------------------------------------------------------------ 16 | 17 | 18 | -- Check the end of the script for some explanations! 19 | if (simGetScriptExecutionCount()==0) then 20 | 21 | end 22 | 23 | simHandleChildScripts(sim_call_type) 24 | 25 | local currentTime=simGetSimulationTime() 26 | 27 | simSetFloatSignal('CurrentTime',currentTime) 28 | 29 | end 30 | 31 | 32 | if (sim_call_type==sim_childscriptcall_sensing) then 33 | simHandleChildScripts(sim_call_type) 34 | end 35 | 36 | 37 | if (sim_call_type==sim_childscriptcall_cleanup) then 38 | 39 | -- Put some restoration code here 40 | 41 | end 42 | -------------------------------------------------------------------------------- /software/samples/handsoff_demo.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env python 2 | 3 | import cv2 4 | import sys 5 | import time 6 | 7 | from contextlib import closing 8 | from collections import deque 9 | 10 | from pypot.creatures import PoppyErgoJr 11 | from pypot.primitive import LoopPrimitive 12 | from poppy_ergo_jr.postures import IdleBreathing 13 | 14 | 15 | RETRY = 5.0 16 | 17 | 18 | def make_jr_or_die_trying(): 19 | while True: 20 | try: 21 | jr = PoppyErgoJr() 22 | break 23 | except (IndexError, ValueError, OSError): 24 | print('Tries to connect to the ErgoJr failed!' 25 | ' Retry in {}s...'.format(RETRY)) 26 | time.sleep(RETRY) 27 | # except (EnvironmentError): 28 | # print('You most likely have to unplug/replug your ErgoJr!') 29 | # sys.exit(1) 30 | 31 | print('Sucessfully connected to the ErgoJr!') 32 | return jr 33 | 34 | 35 | class DemoMode(LoopPrimitive): 36 | def setup(self): 37 | self.dance_marker = 233511930 38 | self.state = 'breathing' 39 | self._seen_faces = deque([], 30) 40 | 41 | self.breathing = IdleBreathing(self.robot, 1.) 42 | self.breathing.start() 43 | 44 | def update(self): 45 | self._seen_faces.append(len(self.robot.face_detector.faces) > 0) 46 | 47 | if self.state == 'breathing': 48 | marker = [m for m in self.robot.marker_detector.markers 49 | if m.id == self.dance_marker] 50 | 51 | if marker: 52 | self.breathing.stop() 53 | 54 | self.state = 'dancing' 55 | self.robot.dance.start() 56 | 57 | if sum(self._seen_faces) > .75 * self._seen_faces.maxlen: 58 | self.state = 'tracking' 59 | self.breathing.stop() 60 | self.robot.face_tracking.start() 61 | 62 | elif self.state == 'dancing': 63 | if self.robot.dance.elapsed_time > 10: 64 | self.robot.dance.stop() 65 | 66 | self.state = 'breathing' 67 | self._seen_faces.clear() 68 | self.breathing.start() 69 | 70 | elif self.state == 'tracking': 71 | if sum(self._seen_faces) < .25 * self._seen_faces.maxlen: 72 | self.robot.face_tracking.stop() 73 | self._seen_faces.clear() 74 | 75 | self.state = 'breathing' 76 | self.breathing.start() 77 | 78 | img = self.robot.camera.frame 79 | for face in self.robot.face_detector.faces: 80 | face.draw(img) 81 | cv2.imshow('live', img) 82 | cv2.waitKey(10) 83 | 84 | def teardown(self): 85 | self.breathing.stop() 86 | 87 | 88 | if __name__ == '__main__': 89 | with closing(make_jr_or_die_trying()) as jr: 90 | demo = DemoMode(jr, 5.) 91 | 92 | print('Slowly raising...') 93 | jr.safe_power_up.start() 94 | jr.safe_power_up.wait_to_stop() 95 | 96 | print('Starting the demo mode!') 97 | demo.start() 98 | 99 | try: 100 | while True: 101 | time.sleep(1000) 102 | except KeyboardInterrupt: 103 | print('Stopping demo and leaving.') 104 | demo.stop() 105 | -------------------------------------------------------------------------------- /software/samples/img/motors.png: -------------------------------------------------------------------------------- 1 | version https://git-lfs.github.com/spec/v1 2 | oid sha256:b7dde72c8f8034ae8d9d0cf3f12a605777a036c2d95cc84df4f83a360d9684f7 3 | size 302493 4 | -------------------------------------------------------------------------------- /software/samples/marker_demo.py: -------------------------------------------------------------------------------- 1 | import cv2 2 | 3 | from pypot.creatures import PoppyErgoJr 4 | 5 | if __name__ == '__main__': 6 | jr = PoppyErgoJr() 7 | 8 | while True: 9 | img = jr.camera.frame 10 | 11 | for m in jr.marker_detector.markers: 12 | m.draw_contour(img) 13 | 14 | cv2.imshow('live', img) 15 | cv2.waitKey(100) 16 | -------------------------------------------------------------------------------- /software/samples/notebooks/Discover your Poppy Ergo Jr.ipynb: -------------------------------------------------------------------------------- 1 | { 2 | "cells": [ 3 | { 4 | "cell_type": "markdown", 5 | "metadata": {}, 6 | "source": [ 7 | "# Discover your Poppy Ergo Jr" 8 | ] 9 | }, 10 | { 11 | "cell_type": "markdown", 12 | "metadata": {}, 13 | "source": [ 14 | "This notebook will guide you in your very first steps with Poppy Ergo Jr in Python. \n", 15 | "\n", 16 | "What you will see in this notebook:\n", 17 | "\n", 18 | "1. Instantiate your robot\n", 19 | "2. Access motors, send motor commands\n", 20 | "3. Read sensor value\n", 21 | "4. Start high level behaviors" 22 | ] 23 | }, 24 | { 25 | "cell_type": "markdown", 26 | "metadata": {}, 27 | "source": [ 28 | "![Poppy Ergo Jr](http://docs.poppy-project.org/en/assembly-guides/ergo-jr/img/ergo_tools.gif)" 29 | ] 30 | }, 31 | { 32 | "cell_type": "markdown", 33 | "metadata": {}, 34 | "source": [ 35 | "*We assume here that you are connected to a real Poppy Ergo Jr that you have assembled and configured (you can referer to the [documentation](http://docs.poppy-project.org) if you haven't done in yet). You can use any tool. For the sensor section, you need to have connected the camera. In a notebook, click a cell and press ▶⏸ (or Shift+Enter) to execute it.*" 36 | ] 37 | }, 38 | { 39 | "cell_type": "code", 40 | "execution_count": null, 41 | "metadata": { 42 | "collapsed": false 43 | }, 44 | "outputs": [], 45 | "source": [ 46 | "%matplotlib inline\n", 47 | "import numpy as np\n", 48 | "import matplotlib.pyplot as plt" 49 | ] 50 | }, 51 | { 52 | "cell_type": "markdown", 53 | "metadata": {}, 54 | "source": [ 55 | "## Instantiate your robot" 56 | ] 57 | }, 58 | { 59 | "cell_type": "markdown", 60 | "metadata": {}, 61 | "source": [ 62 | "To start using your robot in Python, you first need to instantiate it. You can do that by running the following code:" 63 | ] 64 | }, 65 | { 66 | "cell_type": "code", 67 | "execution_count": null, 68 | "metadata": { 69 | "collapsed": false 70 | }, 71 | "outputs": [], 72 | "source": [ 73 | "from pypot.creatures import PoppyErgoJr\n", 74 | "\n", 75 | "poppy = PoppyErgoJr()\n", 76 | "\n", 77 | "# If you want to use the robot with the camera unplugged, \n", 78 | "# you have to pass the parameter camera='dummy'\n", 79 | "# poppy = PoppyErgoJr(camera='dummy')\n", 80 | "\n", 81 | "# If you want to use a simulated robot in the 3D web viewer aka \"poppy simu\"\n", 82 | "# poppy = PoppyErgoJr(simulator='poppy-simu')\n", 83 | "# then go to http://simu.poppy-project.org/poppy-ergo-jr/ and check \"synchroniser\"\n", 84 | "\n", 85 | "# If you want to use the robot with the CoppeliaSim simulator, open the simulator and execute:\n", 86 | "# poppy = PoppyErgoJr(simulator='vrep')\n", 87 | "# You can also change the end effector tools if you precise the V-REP scene\n", 88 | "# poppy = PoppyErgoJr(simulator='vrep', scene=\"poppy_ergo_jr_holder.ttt\")\n", 89 | "# poppy = PoppyErgoJr(simulator='vrep', scene=\"poppy_ergo_jr_empty.ttt\")\n", 90 | "\n" 91 | ] 92 | }, 93 | { 94 | "cell_type": "markdown", 95 | "metadata": {}, 96 | "source": [ 97 | "This creates a [Robot](http://poppy-project.github.io/pypot/pypot.robot.html#pypot.robot.robot.Robot) object that can be used to access the motors and sensors by . The *motors* and *sensors* fields of the Robot then reflect the actual robot state." 98 | ] 99 | }, 100 | { 101 | "cell_type": "markdown", 102 | "metadata": {}, 103 | "source": [ 104 | "Before doing anything else, we will move the robot to its rest position:" 105 | ] 106 | }, 107 | { 108 | "cell_type": "code", 109 | "execution_count": null, 110 | "metadata": { 111 | "collapsed": true 112 | }, 113 | "outputs": [], 114 | "source": [ 115 | "poppy.rest_posture.start()" 116 | ] 117 | }, 118 | { 119 | "cell_type": "markdown", 120 | "metadata": {}, 121 | "source": [ 122 | "## Access motors" 123 | ] 124 | }, 125 | { 126 | "cell_type": "markdown", 127 | "metadata": {}, 128 | "source": [ 129 | "In a Poppy Ergo Jr robot, the motors are named as illustrated below:\n", 130 | "\n", 131 | "\"Motors" 132 | ] 133 | }, 134 | { 135 | "cell_type": "markdown", 136 | "metadata": {}, 137 | "source": [ 138 | "From the [Robot](http://poppy-project.github.io/pypot/pypot.robot.html#pypot.robot.robot.Robot) object, you can directly retrieve the list of motors connected:" 139 | ] 140 | }, 141 | { 142 | "cell_type": "code", 143 | "execution_count": null, 144 | "metadata": { 145 | "collapsed": false 146 | }, 147 | "outputs": [], 148 | "source": [ 149 | "poppy.motors" 150 | ] 151 | }, 152 | { 153 | "cell_type": "markdown", 154 | "metadata": {}, 155 | "source": [ 156 | "As you can see *poppy.motors* holds a list of all motors." 157 | ] 158 | }, 159 | { 160 | "cell_type": "markdown", 161 | "metadata": {}, 162 | "source": [ 163 | "You can retrieve all motors name:" 164 | ] 165 | }, 166 | { 167 | "cell_type": "code", 168 | "execution_count": null, 169 | "metadata": { 170 | "collapsed": false 171 | }, 172 | "outputs": [], 173 | "source": [ 174 | "for m in poppy.motors:\n", 175 | " print(m.name)" 176 | ] 177 | }, 178 | { 179 | "cell_type": "markdown", 180 | "metadata": {}, 181 | "source": [ 182 | " Each of them can be accessed directly from its name. For instance:" 183 | ] 184 | }, 185 | { 186 | "cell_type": "code", 187 | "execution_count": null, 188 | "metadata": { 189 | "collapsed": false 190 | }, 191 | "outputs": [], 192 | "source": [ 193 | "poppy.m1" 194 | ] 195 | }, 196 | { 197 | "cell_type": "markdown", 198 | "metadata": {}, 199 | "source": [ 200 | "### Read values from the motors" 201 | ] 202 | }, 203 | { 204 | "cell_type": "markdown", 205 | "metadata": {}, 206 | "source": [ 207 | "From the motor object you can access its registers. The main ones are:\n", 208 | "\n", 209 | "* **present_position**: the current angle of the motor (in degrees)\n", 210 | "* **present_speed**: the current speed of the motor (in degrees per second)\n", 211 | "* **present_load**: the current workload of the motor (in percentage of max load)\n", 212 | "* **present_temperature**: the current temperature of the motor (in celsius degrees)\n", 213 | "* **angle_limit**: the reachable limits of the motor (in degrees)\n", 214 | "\n", 215 | "They can be consulted directly:" 216 | ] 217 | }, 218 | { 219 | "cell_type": "code", 220 | "execution_count": null, 221 | "metadata": { 222 | "collapsed": false 223 | }, 224 | "outputs": [], 225 | "source": [ 226 | "poppy.m1.present_temperature" 227 | ] 228 | }, 229 | { 230 | "cell_type": "markdown", 231 | "metadata": {}, 232 | "source": [ 233 | "Or, to get the present position for all motors:" 234 | ] 235 | }, 236 | { 237 | "cell_type": "code", 238 | "execution_count": null, 239 | "metadata": { 240 | "collapsed": false 241 | }, 242 | "outputs": [], 243 | "source": [ 244 | "[m.present_position for m in poppy.motors]" 245 | ] 246 | }, 247 | { 248 | "cell_type": "markdown", 249 | "metadata": {}, 250 | "source": [ 251 | "It is important to notice that these fields, such as the *poppy.m1.present_position*, are automatically updated as the real robot moves." 252 | ] 253 | }, 254 | { 255 | "cell_type": "markdown", 256 | "metadata": {}, 257 | "source": [ 258 | "### Send motor commands" 259 | ] 260 | }, 261 | { 262 | "cell_type": "markdown", 263 | "metadata": {}, 264 | "source": [ 265 | "Additionally to the registers presented hereabove, there are other ones used to send commands. For instance, the angular position of a motor is split in two different registers: \n", 266 | "\n", 267 | "* the read-only **present_position** of the motor\n", 268 | "* the read-write **goal_position** which sends to the motor a target position that it will try to reach.\n", 269 | "\n", 270 | "If you want to set a new position for a motor, you can write:" 271 | ] 272 | }, 273 | { 274 | "cell_type": "code", 275 | "execution_count": null, 276 | "metadata": { 277 | "collapsed": true 278 | }, 279 | "outputs": [], 280 | "source": [ 281 | "poppy.m1.goal_position = 20" 282 | ] 283 | }, 284 | { 285 | "cell_type": "markdown", 286 | "metadata": {}, 287 | "source": [ 288 | "You should see the first motor going to a 20 degrees angle. Sending motor commands is as simple as that. Then, to make it turn backwards:" 289 | ] 290 | }, 291 | { 292 | "cell_type": "code", 293 | "execution_count": null, 294 | "metadata": { 295 | "collapsed": true 296 | }, 297 | "outputs": [], 298 | "source": [ 299 | "poppy.m1.goal_position = -20" 300 | ] 301 | }, 302 | { 303 | "cell_type": "markdown", 304 | "metadata": {}, 305 | "source": [ 306 | "In the examples above, the motor turned as fast as possible (this is its default mode). You can change its *moving_speed* (i.e. its maximum possible speed) this way:" 307 | ] 308 | }, 309 | { 310 | "cell_type": "code", 311 | "execution_count": null, 312 | "metadata": { 313 | "collapsed": true 314 | }, 315 | "outputs": [], 316 | "source": [ 317 | "poppy.m1.moving_speed = 50" 318 | ] 319 | }, 320 | { 321 | "cell_type": "markdown", 322 | "metadata": {}, 323 | "source": [ 324 | "Now the motor *m1* can not move faster than 50 degrees per second. If we ask to move again, you should see the difference:" 325 | ] 326 | }, 327 | { 328 | "cell_type": "code", 329 | "execution_count": null, 330 | "metadata": { 331 | "collapsed": true 332 | }, 333 | "outputs": [], 334 | "source": [ 335 | "poppy.m1.goal_position = 90" 336 | ] 337 | }, 338 | { 339 | "cell_type": "markdown", 340 | "metadata": {}, 341 | "source": [ 342 | "The main write registers are:\n", 343 | "\n", 344 | "* **goal_position**: target position in degrees\n", 345 | "* **moving_speed**: maximum reachable speed in degrees per second\n", 346 | "* **compliant** (explained below) " 347 | ] 348 | }, 349 | { 350 | "cell_type": "markdown", 351 | "metadata": {}, 352 | "source": [ 353 | "The dynamixel servo motors have two modes:\n", 354 | "\n", 355 | "* **stiff**: the normal mode for motors in which they are driven by the software\n", 356 | "* **compliant**: a mode where the motors can be freely moved by hand.\n", 357 | "\n", 358 | "You can switch from one mode to the other using the *compliant* register. For instance, you can turn the motor *m6* compliant via:" 359 | ] 360 | }, 361 | { 362 | "cell_type": "code", 363 | "execution_count": null, 364 | "metadata": { 365 | "collapsed": true 366 | }, 367 | "outputs": [], 368 | "source": [ 369 | "poppy.m6.compliant = True" 370 | ] 371 | }, 372 | { 373 | "cell_type": "markdown", 374 | "metadata": {}, 375 | "source": [ 376 | "You should now be able to move this motor by hand. This is particularly useful for programming your robot by demonstration (see the dedicated notebook)." 377 | ] 378 | }, 379 | { 380 | "cell_type": "markdown", 381 | "metadata": {}, 382 | "source": [ 383 | " And to turn it stiff again:" 384 | ] 385 | }, 386 | { 387 | "cell_type": "code", 388 | "execution_count": null, 389 | "metadata": { 390 | "collapsed": true 391 | }, 392 | "outputs": [], 393 | "source": [ 394 | "poppy.m6.compliant = False" 395 | ] 396 | }, 397 | { 398 | "cell_type": "markdown", 399 | "metadata": {}, 400 | "source": [ 401 | "### Control the motor's LED" 402 | ] 403 | }, 404 | { 405 | "cell_type": "markdown", 406 | "metadata": {}, 407 | "source": [ 408 | "The XL-320 motors of the Poppy Ergo Jr robot have a small colored LED. You can change its color programatically from Python. This is a great way to make your robot more customized and expressive.\n", 409 | "\n", 410 | "If you want to turn on the LED of the first motor and make it green you simply have to run:" 411 | ] 412 | }, 413 | { 414 | "cell_type": "code", 415 | "execution_count": null, 416 | "metadata": { 417 | "collapsed": true 418 | }, 419 | "outputs": [], 420 | "source": [ 421 | "poppy.m1.led = 'green'" 422 | ] 423 | }, 424 | { 425 | "cell_type": "markdown", 426 | "metadata": {}, 427 | "source": [ 428 | "And to turn it off again:" 429 | ] 430 | }, 431 | { 432 | "cell_type": "code", 433 | "execution_count": null, 434 | "metadata": { 435 | "collapsed": true 436 | }, 437 | "outputs": [], 438 | "source": [ 439 | "poppy.m1.led = 'off'" 440 | ] 441 | }, 442 | { 443 | "cell_type": "markdown", 444 | "metadata": {}, 445 | "source": [ 446 | "Obviously you can also do some more complex LED blinking. For instance:" 447 | ] 448 | }, 449 | { 450 | "cell_type": "code", 451 | "execution_count": null, 452 | "metadata": { 453 | "collapsed": true 454 | }, 455 | "outputs": [], 456 | "source": [ 457 | "import time\n", 458 | "\n", 459 | "for m in poppy.motors:\n", 460 | " time.sleep(0.5)\n", 461 | " m.led = 'yellow'\n", 462 | " time.sleep(1.0)\n", 463 | " m.led = 'off'" 464 | ] 465 | }, 466 | { 467 | "cell_type": "markdown", 468 | "metadata": {}, 469 | "source": [ 470 | "You can retrieve all available LED colors using:" 471 | ] 472 | }, 473 | { 474 | "cell_type": "code", 475 | "execution_count": null, 476 | "metadata": { 477 | "collapsed": true 478 | }, 479 | "outputs": [], 480 | "source": [ 481 | "from pypot.dynamixel.conversion import XL320LEDColors\n", 482 | "\n", 483 | "print(list(XL320LEDColors))" 484 | ] 485 | }, 486 | { 487 | "cell_type": "markdown", 488 | "metadata": {}, 489 | "source": [ 490 | "## Read sensors" 491 | ] 492 | }, 493 | { 494 | "cell_type": "markdown", 495 | "metadata": {}, 496 | "source": [ 497 | "Reading sensors is exactly the same as reading registers from your robot. The sensors can be accessed via:" 498 | ] 499 | }, 500 | { 501 | "cell_type": "code", 502 | "execution_count": null, 503 | "metadata": { 504 | "collapsed": false 505 | }, 506 | "outputs": [], 507 | "source": [ 508 | "poppy.sensors" 509 | ] 510 | }, 511 | { 512 | "cell_type": "markdown", 513 | "metadata": {}, 514 | "source": [ 515 | "Here, we have 2 sensors:\n", 516 | "* a camera\n", 517 | "* a marker detector\n", 518 | "\n", 519 | "They can be accessed via their name:" 520 | ] 521 | }, 522 | { 523 | "cell_type": "code", 524 | "execution_count": null, 525 | "metadata": { 526 | "collapsed": false 527 | }, 528 | "outputs": [], 529 | "source": [ 530 | "poppy.camera" 531 | ] 532 | }, 533 | { 534 | "cell_type": "markdown", 535 | "metadata": {}, 536 | "source": [ 537 | "You can retrieve all the existing registers of a sensor:" 538 | ] 539 | }, 540 | { 541 | "cell_type": "code", 542 | "execution_count": null, 543 | "metadata": { 544 | "collapsed": false 545 | }, 546 | "outputs": [], 547 | "source": [ 548 | "poppy.camera.registers" 549 | ] 550 | }, 551 | { 552 | "cell_type": "markdown", 553 | "metadata": {}, 554 | "source": [ 555 | "For instance, use this code to retrieve and display an image from the camera:" 556 | ] 557 | }, 558 | { 559 | "cell_type": "code", 560 | "execution_count": null, 561 | "metadata": { 562 | "collapsed": false 563 | }, 564 | "outputs": [], 565 | "source": [ 566 | "img = poppy.camera.frame\n", 567 | "plt.imshow(img)" 568 | ] 569 | }, 570 | { 571 | "cell_type": "markdown", 572 | "metadata": {}, 573 | "source": [ 574 | "Similarly to motors, the sensor values are automatically synchronized in background with the real sensors. If you run again the previous code, you will see a more recent image:" 575 | ] 576 | }, 577 | { 578 | "cell_type": "code", 579 | "execution_count": null, 580 | "metadata": { 581 | "collapsed": true 582 | }, 583 | "outputs": [], 584 | "source": [ 585 | "plt.imshow(poppy.camera.frame)" 586 | ] 587 | }, 588 | { 589 | "cell_type": "markdown", 590 | "metadata": {}, 591 | "source": [ 592 | "## High level behaviors" 593 | ] 594 | }, 595 | { 596 | "cell_type": "markdown", 597 | "metadata": {}, 598 | "source": [ 599 | "The Poppy Ergo Jr robot comes with a set of pre-defined behaviors. They can be static postures - such as the rest posture used at the beginning - or motions, like a dance" 600 | ] 601 | }, 602 | { 603 | "cell_type": "markdown", 604 | "metadata": {}, 605 | "source": [ 606 | "You can find the exhaustive list using the *primitives* field:" 607 | ] 608 | }, 609 | { 610 | "cell_type": "code", 611 | "execution_count": null, 612 | "metadata": { 613 | "collapsed": false 614 | }, 615 | "outputs": [], 616 | "source": [ 617 | "[p.name for p in poppy.primitives]" 618 | ] 619 | }, 620 | { 621 | "cell_type": "markdown", 622 | "metadata": {}, 623 | "source": [ 624 | "Those behaviors (named \"primitives\") can be started, stopped and paused during runtime." 625 | ] 626 | }, 627 | { 628 | "cell_type": "code", 629 | "execution_count": null, 630 | "metadata": { 631 | "collapsed": true 632 | }, 633 | "outputs": [], 634 | "source": [ 635 | "poppy.tetris_posture.start()" 636 | ] 637 | }, 638 | { 639 | "cell_type": "markdown", 640 | "metadata": {}, 641 | "source": [ 642 | "You can make the Poppy Ergo Jr dance for 10 seconds:" 643 | ] 644 | }, 645 | { 646 | "cell_type": "code", 647 | "execution_count": null, 648 | "metadata": { 649 | "collapsed": true 650 | }, 651 | "outputs": [], 652 | "source": [ 653 | "import time\n", 654 | "\n", 655 | "poppy.dance.start()\n", 656 | "time.sleep(10)\n", 657 | "poppy.dance.stop()" 658 | ] 659 | }, 660 | { 661 | "cell_type": "markdown", 662 | "metadata": {}, 663 | "source": [ 664 | "## Going further\n", 665 | "\n", 666 | "Now that you have learnt the basis of what you can do with a Poppy Ergo Jr, there is much more to discover:\n", 667 | "* how to record/replay move by demonstration\n", 668 | "* how to define your own high-level behavior (e.g. a visual servoing of the tip of the robot using blob detection)\n", 669 | "* how to make Poppy Ergo Jr a connected device so that its communicates with the rest of the world using HTTP requests\n", 670 | "* ...\n", 671 | "\n", 672 | "You can find other examples in the [docs](http://docs.poppy-project.org) or in the notebook folder next to this one. This notebook is coming to an end. Select **File** > **Open** to open another example notebook." 673 | ] 674 | } 675 | ], 676 | "metadata": { 677 | "anaconda-cloud": {}, 678 | "kernelspec": { 679 | "display_name": "Python [default]", 680 | "language": "python", 681 | "name": "python2" 682 | }, 683 | "language_info": { 684 | "codemirror_mode": { 685 | "name": "ipython", 686 | "version": 2 687 | }, 688 | "file_extension": ".py", 689 | "mimetype": "text/x-python", 690 | "name": "python", 691 | "nbconvert_exporter": "python", 692 | "pygments_lexer": "ipython2", 693 | "version": "2.7.12" 694 | } 695 | }, 696 | "nbformat": 4, 697 | "nbformat_minor": 0 698 | } 699 | -------------------------------------------------------------------------------- /software/samples/testbed.py: -------------------------------------------------------------------------------- 1 | import cv2 2 | import time 3 | import pylab 4 | import psutil 5 | 6 | from contextlib import closing 7 | from numpy import mean, std 8 | 9 | from pypot.primitive.utils import PositionWatcher 10 | from pypot.creatures import PoppyErgoJr 11 | from hampy import detect_markers 12 | 13 | D = 10 14 | 15 | cpu = [] 16 | 17 | if __name__ == '__main__': 18 | psutil.cpu_percent() 19 | time.sleep(.5) 20 | 21 | with closing(PoppyErgoJr()) as jr: 22 | jr.rest_posture.start() 23 | jr.rest_posture.wait_to_stop() 24 | 25 | traj_rec = PositionWatcher(jr, 25., jr.motors) 26 | 27 | jr.dance.start() 28 | traj_rec.start() 29 | 30 | t0 = time.time() 31 | while time.time() - t0 < D: 32 | cpu.append(psutil.cpu_percent()) 33 | 34 | img = jr.camera.frame 35 | markers = detect_markers(img) 36 | for m in markers: 37 | m.draw_contour(img) 38 | 39 | time.sleep(.1) 40 | 41 | jr.dance.stop() 42 | traj_rec.stop() 43 | 44 | print('CPU M={}% (STD={})'.format(mean(cpu) * 4, std(cpu) * 4)) 45 | 46 | fig = pylab.figure() 47 | ax = pylab.axes() 48 | traj_rec.plot(ax) 49 | pylab.show() 50 | fig.savefig('bench.png') 51 | -------------------------------------------------------------------------------- /software/setup.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env python 2 | 3 | import re 4 | import sys 5 | 6 | from setuptools import setup, find_packages 7 | 8 | 9 | def version(): 10 | with open('poppy_ergo_jr/_version.py') as f: 11 | return re.search(r"^__version__ = ['\"]([^'\"]*)['\"]", f.read()).group(1) 12 | 13 | 14 | setup(name='poppy-ergo-jr', 15 | version=version(), 16 | packages=find_packages(), 17 | 18 | install_requires=['pypot >= 4.0.0', 'hampy >= 1.4.2'], 19 | 20 | include_package_data=True, 21 | exclude_package_data={'': ['README', '.gitignore']}, 22 | 23 | zip_safe=False, 24 | 25 | author='Poppy Station', 26 | author_email='dev@poppy-station.org', 27 | description='Poppy Ergo Jr Software Library', 28 | url='https://poppy-project.org', 29 | license='GNU GENERAL PUBLIC LICENSE Version 3', 30 | 31 | ) 32 | --------------------------------------------------------------------------------