Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
174 commits
Select commit Hold shift + click to select a range
82d3011
Update _config.yml
DiegoPrestamo May 23, 2023
7a3c27b
Update _config.yml
DiegoPrestamo May 23, 2023
d00b728
Update _config.yml
DiegoPrestamo May 23, 2023
2ba0e52
Update 2014-3-3-Hello-World.md
DiegoPrestamo May 23, 2023
cd92471
Update _config.yml
DiegoPrestamo May 23, 2023
1882536
Update and rename 2014-3-3-Hello-World.md to 2023-5-22-Hello-World.md
DiegoPrestamo May 23, 2023
ce7a980
Update about.md
DiegoPrestamo May 23, 2023
86cb495
Update 2023-5-22-Hello-World.md
DiegoPrestamo May 23, 2023
aa92819
Update 2023-5-22-Hello-World.md
DiegoPrestamo May 23, 2023
5249df2
Update 2023-5-22-Hello-World.md
DiegoPrestamo May 23, 2023
87eac9d
Update 2023-5-22-Hello-World.md
DiegoPrestamo May 23, 2023
8456f80
Update 2023-5-22-Hello-World.md
DiegoPrestamo May 23, 2023
df7a90d
Rename 2023-5-22-Hello-World.md to 2023-5-22-Poppy-Blog.md
DiegoPrestamo May 23, 2023
04a2589
Update about.md
DiegoPrestamo May 23, 2023
cbf5cb5
Update 2023-5-22-Poppy-Blog.md
DiegoPrestamo May 23, 2023
a9ae2c2
Update 2023-5-22-Poppy-Blog.md
DiegoPrestamo May 23, 2023
d2e9d7f
Update 2023-5-22-Poppy-Blog.md
DiegoPrestamo May 24, 2023
fd28cf6
Update 2023-5-22-Poppy-Blog.md
DiegoPrestamo May 24, 2023
8abfa9f
Update 2023-5-22-Poppy-Blog.md
DiegoPrestamo May 24, 2023
c4d0fcb
Update 2023-5-22-Poppy-Blog.md
DiegoPrestamo May 24, 2023
3546f06
Update 2023-5-22-Poppy-Blog.md
DiegoPrestamo May 24, 2023
d187610
Update 2023-5-22-Poppy-Blog.md
DiegoPrestamo May 24, 2023
bd42325
Update 2023-5-22-Poppy-Blog.md
DiegoPrestamo May 24, 2023
3360541
Update 2023-5-22-Poppy-Blog.md
DiegoPrestamo May 24, 2023
460aaee
Update 2023-5-22-Poppy-Blog.md
DiegoPrestamo May 24, 2023
87a186f
Update 2023-5-22-Poppy-Blog.md
DiegoPrestamo May 24, 2023
b248a24
Update 2023-5-22-Poppy-Blog.md
DiegoPrestamo May 24, 2023
34dd033
Update 2023-5-24-Poppy-Blog.md
DiegoPrestamo May 24, 2023
939fb6a
Update 2023-5-22-Poppy-Blog.md
DiegoPrestamo May 24, 2023
ce56b05
Update 2023-5-22-Poppy-Blog.md
DiegoPrestamo May 24, 2023
7491bda
Update 2023-5-22-Poppy-Blog.md
DiegoPrestamo May 24, 2023
2145de8
Update 2023-5-22-Poppy-Blog.md
DiegoPrestamo May 24, 2023
2587a23
Update 2023-5-24-Poppy-Blog.md
DiegoPrestamo May 24, 2023
8765409
Update 2023-5-24-Poppy-Blog.md
DiegoPrestamo May 24, 2023
b81e7c1
Create Coming Soon: Arduino Braccio Project
DiegoPrestamo May 24, 2023
a8841fe
Update Coming Soon: Arduino Braccio Project
DiegoPrestamo May 24, 2023
8e7e06b
Delete Coming Soon: Arduino Braccio Project
DiegoPrestamo May 24, 2023
75fe949
Create Arduino Braccio.md
DiegoPrestamo May 24, 2023
7ca20b2
Update Arduino Braccio.md
DiegoPrestamo May 24, 2023
74ddbb2
Update Arduino Braccio.md
DiegoPrestamo May 24, 2023
21afa12
Rename Arduino Braccio.md to 2023-5-24-Arduino-Braccio.md
DiegoPrestamo May 24, 2023
33fda38
Update 2023-5-24-Arduino-Braccio.md
DiegoPrestamo May 25, 2023
f7e6ad7
Update 2023-5-24-Arduino-Braccio.md
DiegoPrestamo May 25, 2023
787118a
Add files via upload
DiegoPrestamo May 25, 2023
7aba639
Update 2023-5-24-Arduino-Braccio.md
DiegoPrestamo May 25, 2023
a852f70
Update 2023-5-24-Arduino-Braccio.md
DiegoPrestamo May 25, 2023
d304f95
Update 2023-5-24-Arduino-Braccio.md
DiegoPrestamo May 25, 2023
b817e16
Update 2023-5-24-Arduino-Braccio.md
DiegoPrestamo May 25, 2023
7c61114
Create 2023-5-23-Controlling-Gripper-with-Hand
DiegoPrestamo May 25, 2023
531ff1f
Update 2023-5-23-Controlling-Gripper-with-Hand
DiegoPrestamo May 25, 2023
0eb371b
Update 2023-5-24-Arduino-Braccio.md
DiegoPrestamo May 25, 2023
1659fbe
Update 2023-5-23-Controlling-Gripper-with-Hand
DiegoPrestamo May 25, 2023
6bd8c27
Update 2023-5-24-Arduino-Braccio.md
DiegoPrestamo May 25, 2023
47c3927
Update 2023-5-24-Arduino-Braccio.md
DiegoPrestamo May 25, 2023
bfe47a6
Update and rename 2023-5-23-Controlling-Gripper-with-Hand to 2023-5-2…
DiegoPrestamo May 25, 2023
4e02a9f
Update 2023-5-24-Arduino-Braccio.md
DiegoPrestamo May 25, 2023
7149ff2
Update 2023-5-24-Arduino-Braccio.md
DiegoPrestamo May 25, 2023
bb32f92
Update 2023-5-23-Controlling-Gripper-with-Hand.md
DiegoPrestamo May 25, 2023
7cccc51
Rename 2023-5-23-Controlling-Gripper-with-Hand.md to 2023-5-21-Contro…
DiegoPrestamo May 25, 2023
d69ee18
Update 2023-5-21-Controlling-Gripper-with-Hand.md
DiegoPrestamo May 26, 2023
f3fe4a5
Update 2023-5-21-Controlling-Gripper-with-Hand.md
DiegoPrestamo May 26, 2023
b655901
Rename 2023-5-21-Controlling-Gripper-with-Hand.md to 2023-5-25-Contro…
DiegoPrestamo May 26, 2023
0e6b6b3
Update 2023-5-25-Controlling-Gripper-with-Hand.md
DiegoPrestamo May 26, 2023
8239308
Update 2023-5-22-Poppy-Blog.md
DiegoPrestamo May 26, 2023
08fbba7
Update 2023-5-25-Controlling-Gripper-with-Hand.md
DiegoPrestamo May 26, 2023
5f40b66
Update and rename 2023-5-24-Arduino-Braccio.md to 2023-5-26-Arduino-B…
DiegoPrestamo May 26, 2023
137e819
Update 2023-5-25-Controlling-Gripper-with-Hand.md
DiegoPrestamo May 26, 2023
7073e52
Update 2023-5-26-Arduino-Braccio.md
DiegoPrestamo May 28, 2023
8e650e2
Update style.scss
DiegoPrestamo May 29, 2023
a2862b3
Update style.scss
DiegoPrestamo May 29, 2023
7ebee4c
Update style.scss
DiegoPrestamo May 29, 2023
80e49ad
Update style.scss
DiegoPrestamo May 29, 2023
7b92f17
Update style.scss
DiegoPrestamo May 29, 2023
656372f
Update style.scss
DiegoPrestamo May 29, 2023
a027643
Add files via upload
DiegoPrestamo May 29, 2023
96c79f5
Update _config.yml
DiegoPrestamo May 29, 2023
4493686
Update style.scss
DiegoPrestamo May 29, 2023
1f0465b
Update style.scss
DiegoPrestamo May 29, 2023
945a119
Update style.scss
DiegoPrestamo May 29, 2023
750191c
Update style.scss
DiegoPrestamo May 29, 2023
309554d
Update 2023-5-26-Arduino-Braccio.md
DiegoPrestamo May 29, 2023
b597fdf
Update style.scss
DiegoPrestamo May 29, 2023
29f3527
Update style.scss
DiegoPrestamo May 30, 2023
228d2b1
Update style.scss
DiegoPrestamo May 30, 2023
ccb26fc
Update style.scss
DiegoPrestamo May 30, 2023
b340581
Update style.scss
DiegoPrestamo May 30, 2023
cd71c79
Update style.scss
DiegoPrestamo May 30, 2023
f0b6813
Update style.scss
DiegoPrestamo May 30, 2023
088c6dc
Create 2023-5-20-Post-in-Progress.md
DiegoPrestamo May 30, 2023
3826b15
Update style.scss
DiegoPrestamo May 30, 2023
bffca2b
Update 2023-5-20-Post-in-Progress.md
DiegoPrestamo May 30, 2023
ec1eac9
Update 2023-5-20-Post-in-Progress.md
DiegoPrestamo May 30, 2023
43bfcad
Add files via upload
DiegoPrestamo May 30, 2023
7bb220f
Update 2023-5-20-Post-in-Progress.md
DiegoPrestamo May 30, 2023
b827be8
Update 2023-5-20-Post-in-Progress.md
DiegoPrestamo May 30, 2023
5021ef1
Update 2023-5-20-Post-in-Progress.md
DiegoPrestamo May 30, 2023
13433ad
Add files via upload
DiegoPrestamo May 30, 2023
5cb4285
Delete body_linear_velocity.png
DiegoPrestamo May 30, 2023
b0535a5
Add files via upload
DiegoPrestamo May 30, 2023
57b607a
Update 2023-5-20-Post-in-Progress.md
DiegoPrestamo May 30, 2023
e771a30
Update 2023-5-20-Post-in-Progress.md
DiegoPrestamo May 30, 2023
c0bb1a9
Update style.scss
DiegoPrestamo May 30, 2023
9d6e94a
Update and rename style.scss to style.scss
DiegoPrestamo May 30, 2023
3fc4e02
Update style.scss
DiegoPrestamo May 30, 2023
a84d832
Update style.scss
DiegoPrestamo May 30, 2023
840efcb
Update style.scss
DiegoPrestamo May 30, 2023
a3721ae
Update style.scss
DiegoPrestamo May 30, 2023
33814dc
Update 2023-5-20-Post-in-Progress.md
DiegoPrestamo May 30, 2023
2166d47
Add files via upload
DiegoPrestamo May 30, 2023
d057d72
Update 2023-5-20-Post-in-Progress.md
DiegoPrestamo May 31, 2023
fe47567
changed pic width
May 31, 2023
812d8b5
Delete global_linear_velocity.png
DiegoPrestamo May 31, 2023
9d507a9
Add files via upload
DiegoPrestamo May 31, 2023
7fba852
Delete body_linear_velocity.png
DiegoPrestamo May 31, 2023
6db22ec
Add files via upload
DiegoPrestamo May 31, 2023
ffc0bdf
Add files via upload
DiegoPrestamo May 31, 2023
a04696b
blah
May 31, 2023
6766324
greek letters
May 31, 2023
2454aae
slight mod
May 31, 2023
409b773
finished
May 31, 2023
bcce658
Rename 2023-5-20-Post-in-Progress.md to 2023-5-31-Differential-Drive-…
DiegoPrestamo May 31, 2023
5fc81fe
Update 2023-5-31-Differential-Drive-Robot.md
DiegoPrestamo May 31, 2023
9436c32
Update _config.yml
DiegoPrestamo May 31, 2023
2243173
Delete 2023-5-26-Arduino-Braccio.md
DiegoPrestamo May 31, 2023
f40184f
Update 2023-5-31-Differential-Drive-Robot.md
DiegoPrestamo May 31, 2023
fe81ed5
Create 2023-6-4-Introduction-to-Underactuated-Robotics
DiegoPrestamo Jun 5, 2023
a3b9484
Rename 2023-6-4-Introduction to Underactuated Robotics to 2023-6-4-In…
DiegoPrestamo Jun 5, 2023
15e1b31
underactuated
Jun 6, 2023
01ca880
Update 2023-6-4-Introduction-to-Underactuated-Robotics.md
DiegoPrestamo Jun 7, 2023
54122dd
Update 2023-6-4-Introduction-to-Underactuated-Robotics.md
DiegoPrestamo Jun 7, 2023
e7b89ca
Update 2023-6-4-Introduction-to-Underactuated-Robotics.md
DiegoPrestamo Jun 7, 2023
c6b22eb
Update default.html
DiegoPrestamo Jun 7, 2023
1f7dcd8
Update 2023-6-4-Introduction-to-Underactuated-Robotics.md
DiegoPrestamo Jun 7, 2023
de43c15
Update 2023-6-4-Introduction-to-Underactuated-Robotics.md
DiegoPrestamo Jun 7, 2023
10179da
Update 2023-6-4-Introduction-to-Underactuated-Robotics.md
DiegoPrestamo Jun 7, 2023
ec50fa4
Update 2023-6-4-Introduction-to-Underactuated-Robotics.md
DiegoPrestamo Jun 7, 2023
a0ed535
Update mathjax.html
DiegoPrestamo Jun 7, 2023
f9b1c94
Update 2023-6-4-Introduction-to-Underactuated-Robotics.md
DiegoPrestamo Jun 7, 2023
4f4a78d
edits
Jun 10, 2023
37db935
Update 2023-6-4-Introduction-to-Underactuated-Robotics.md
DiegoPrestamo Jun 10, 2023
bf8747e
Update 2023-6-4-Introduction-to-Underactuated-Robotics.md
DiegoPrestamo Jun 10, 2023
66e997b
coming_soon
Jun 10, 2023
7ad692b
typo
Jun 10, 2023
1fffa13
blah
Jun 10, 2023
05cf44e
Update 2023-6-4-Introduction-to-Underactuated-Robotics.md
DiegoPrestamo Jun 10, 2023
b7eff33
Update and rename 2049-12-6-Coming-Soon.md to 2023-12-6-Coming-Soon.md
DiegoPrestamo Jun 10, 2023
84dbe0d
Lyapunov
Jun 10, 2023
cb55380
currently
Jun 11, 2023
a58cfb3
Update and rename 2023-6-10-Coming-Soon.md to 2026-6-10-Coming-Soon.md
DiegoPrestamo Jun 11, 2023
1b9323b
Update 2023-6-4-Introduction-to-Underactuated-Robotics.md
DiegoPrestamo Jun 19, 2023
ef10be2
Update 2023-6-4-Introduction-to-Underactuated-Robotics.md
DiegoPrestamo Jul 7, 2023
92b8686
changes
Jul 6, 2023
a17823a
cambio
Jul 11, 2023
e4ab665
change
Jul 16, 2023
fc10e5f
cambioo
Jul 16, 2023
9b93261
changee
Jul 16, 2023
0386efc
blah
Jul 16, 2023
da3b29a
update
Aug 29, 2023
ab3e141
update
Aug 31, 2023
ad41445
Update
Oct 18, 2023
22f7561
slight_update
Oct 18, 2023
df3f76d
update
Oct 23, 2023
db910d4
udpate
Oct 25, 2023
25b31be
update
Dec 5, 2023
52eea44
updaate
Dec 5, 2023
16f7082
update
Dec 11, 2023
e9228fc
Add files via upload
DiegoPrestamo Jan 9, 2024
6b366fe
Add files via upload
DiegoPrestamo Jan 11, 2024
fe4ceaf
ns3
Jan 11, 2024
a439a43
update
Jan 12, 2024
067ff94
update
Jan 12, 2024
4780577
update]
Jan 12, 2024
aebaa2e
update
Jan 15, 2024
c0efcb9
about me update
DiegoPrestamo Sep 2, 2025
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Binary file added Screen Recording 2023-05-25 at 01.10.12 PM.gif
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
9 changes: 4 additions & 5 deletions _config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,13 +3,13 @@
#

# Name of your site (displayed in the header)
name: Your Name
name: Engineering Blog - Diego Prestamo

# Short bio or description (displayed in the header)
description: Web Developer from Somewhere
description: Chasing engineering mastery one project at a time

# URL of your avatar or profile pic (you could use your GitHub profile pic)
avatar: https://raw.githubusercontent.com/barryclark/jekyll-now/master/images/jekyll-logo.png
avatar: https://png.pngtree.com/png-vector/20191101/ourmid/pngtree-cartoon-color-simple-male-avatar-png-image_1934459.jpg

#
# Flags below are optional
Expand All @@ -21,12 +21,11 @@ footer-links:
email:
facebook:
flickr:
github: barryclark/jekyll-now
github: DiegoPrestamo
instagram:
linkedin:
pinterest:
rss: # just type anything here for a working RSS icon
twitter: jekyllrb
stackoverflow: # your stackoverflow profile, e.g. "users/50476/bart-kiers"
youtube: # channel/<your_long_string> or user/<user-name>
googleplus: # anything in your profile username that comes after plus.google.com/
Expand Down
17 changes: 17 additions & 0 deletions _includes/mathjax.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
<script type="text/x-mathjax-config">
MathJax.Hub.Config({
TeX: {
equationNumbers: {
autoNumber: "AMS"
}
},
tex2jax: {
inlineMath: [ ['$','$'], ['\\(', '\\)'] ],
displayMath: [ ['$$','$$'] ],
processEscapes: true,
}
});
</script>
<script type="text/javascript" async src="https://cdnjs.cloudflare.com/ajax/libs/mathjax/2.7.5/MathJax.js?config=TeX-AMS-MML_HTMLorMML"></script>


5 changes: 5 additions & 0 deletions _layouts/default.html
Original file line number Diff line number Diff line change
@@ -1,9 +1,14 @@
<!DOCTYPE html>
<html>
<head>
<script id="MathJax-script" async src="https://cdn.jsdelivr.net/npm/mathjax@3/es5/tex-mml-chtml.js"></script>
<title>{% if page.title %}{{ page.title }} – {% endif %}{{ site.name }} – {{ site.description }}</title>

{% include meta.html %}
{% if page.mathjax %}
{% include mathjax.html %}
{% endif %}


<!--[if lt IE 9]>
<script src="http://html5shiv.googlecode.com/svn/trunk/html5.js"></script>
Expand Down
10 changes: 0 additions & 10 deletions _posts/2014-3-3-Hello-World.md

This file was deleted.

240 changes: 240 additions & 0 deletions _posts/2023-5-22-Poppy-Blog.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,240 @@
---
layout: post
title: Controlling a Poppy Humanoid using V-REP / CoppeliaSim
---

#### The Poppy Project is an open-source platform that intertwines science, technology, art, and education. The Poppy Humanoid is the flagship model of the Poppy Project.
<p align="center">
<img src="https://www.poppy-project.org/assets/img/humanoid-skating.jpg" width="800">
</p>

Standing at 83 cm tall, the Poppy Humanoid is almost fully 3D printed and uses 25 motors to animate its body. These features make the Poppy Humanoid a cheaper alternative in the world of complex robotic systems. However, $10,000 is still far too much for (most) 21 year-old college students, so I decided to explore the Poppy Humanoid using V-REP, which is now Coppelia Sim.


## Brief introduction of V-REP and Poppy:
V-REP which is now known as Coppelia Sim is a powerful robotics simulator that allows you to import or create various robots, program them as you would in real life, and simulate them visually and quantitatively. V-REP uses **_Lua_**, a lightweight, high-level, multi-paradigm coding language that is mostly used in embedded systems. The Poppy Humanoid is most commonly programmed in Python with its native **_pypot_** library. Since we want to get as close as possible to working with the real Poppy Humanoid, we will use the Python API support that V-REP comes with. This will save us the hassle of learning **_Lua_** syntax and will make our code almost identical to what we would run on a real-life Poppy Humanoid.
## Step 0: Download **_Python_**
We will be using Python to run our simple code. I am running 3.8.10, but I believe any Python 3 version should work. If you do not have Python installed already, go [here](https://www.python.org/downloads/) and follow the instructions.
## Step 1: Downloading V-REP for your appropriate OS
Have you noticed that I keep saying 'V-REP, which is now named Coppelia sim' instead of 'Coppelia sim, formerly known as V-REP'? Indeed we will be using V-REP and not Coppelia Sim. The Poppy documentation specifically states that Windows users should infact not run Coppelia sim but use [V-REP 3.3.0](https://v-rep-pro-edu.software.informer.com/download/) instead. If you are on Linux, you can use the most recent version of Coppelia Sim (last tested with CoppeliaSIM 4.2.0 + python3.6.12 + Ubuntu 20.04). I am using V-REP EDU, since I am a student and do not intend to commercialized any robots (yet!).

### Step 1.5: For MacOS users with the new ARM64 processors
Close the lid, concede your dignity, sell your computer and downgrade to an Intel chip Mac. Maybe don't do that, but I seriously struggled connecting to the remote API server with my M1 Macbook Pro. It seems like certain API files were simply not built for the new processors (which is strange since there is an 'Apple Silicon' download in Coppelia sim). Maybe someone more competent than me can figure out the issue, or change the files to fit the ARM64 architecture, but I opted for the practical solution: reach into my backpack and pull out my old windows computer that I keep around for situations such as these.
<div align="center">
<p align="center">
<img src="https://github.com/DiegoPrestamo/DiegoPrestamo.github.io/assets/103367642/f43a8e14-e316-4317-85b0-390e5c91345f" width="800">
</p>
The page should look something like this. Hit 'Download now'.
</div>

## Step 2: Scene Synopsis
This is a V-REP scene which I have annotated. I have only highlighted very basic elements of the V-REP scene and I recommend messing with a V-REP scene of your own to get the hang of it.

- The underlined portion is where you have simple controls such as panning in and out, translations in X, Y, Z, rotations about Alpha, Beta, Gamma, and other basic controls. If you want to make a fine tune translation (which are often required, since the regular translation step can be quite large), press **_shift_** while you translate.

- The arrow points to the **_Scene Object Properties_**, an incredibly useful element for specifying how your object will behave in the scene. Here you can change physical properties, dynamic properties, and many other properties.

- The **_Hierarchy_** is where you can see all of the object in the scene and how they relate to each other. If an object is indented under another object, they move together or are related in some way.
<div align="center">
<p>
<img src="https://github.com/DiegoPrestamo/DiegoPrestamo.github.io/assets/103367642/5178c4fb-956f-46d5-b676-7f1169e221f6" width="800">
</p>
A Poppy Torso in the V-REP scene
</div>

## Step 3: Downloading Appropriate Libraries (following standard documentation)
As previously mentioned, **_pypot_** is the Poppy library. We will pip install the Poppy Humanoid which should force install **_pypot_** since it is one of its dependencies. Open a Command prompt (windows + cmd) if on Windows, or open your terminal if on MacOS or Linux. Run the following line of code:
```bash
pip install pypot poppy_humanoid
```
As a sanity check, run the following lines of code in your Command Prompt / Terminal
```bash
from pypot.vrep import from_vrep
from pypot.creatures import PoppyHumanoid
```
If they run with no issues, you are likely okay. Else, troubleshoot using [this](https://docs.poppy-project.org/en/installation/install-poppy-softwares.html) and [that](https://notebook.community/matthieu-lapeyre/pypot/samples/notebooks/Controlling%20a%20Poppy%20humanoid%20in%20V-REP%20using%20pypot).

## Step 4: Load a default Poppy Humanoid into V-REP:
To simply load a default Poppy Humanoid into V-REP, open your favorite **_Python_** IDE and run the following lines of code:
```bash
from pypot.creatures import PoppyHumanoid # make sure not to use 'poppy.creatures' which has now deprecated and will not work

vrep_port = 19997
poppy = PoppyHumanoid(simulator='vrep', port = vrep_port)
```
If you are having errors connecting to V-REP, open _**remoteApiConnections.txt**_ file which is in the V-REP path location
<div align="center">
<p>
<img src="https://github.com/DiegoPrestamo/DiegoPrestamo.github.io/assets/103367642/732e5253-6e01-4679-85b4-d49d6d34d924" width="800">
</p>
I am using 19990 and I created a second port 19991. Yours SHOULD look different, just make sure you match the port number to the port in your script.
</div>


#### When you run your script, you should see the following pop-up:
<div align="center">
<p>
<img src="https://docs.poppy-project.org/en/img/vrep/vrep3_2.png" width="800">
</p>
Image from Poppy documentation
</div>

Make sure to check the box saying 'Do not show this message again' and re-run you script three times until you no longer get this message. This pop-up blocks **_pypot_** communication, which we do not want.

#### A default Poppy Humanoid should now be loaded in a V-REP scence:
<div align="center">
<p>
<img src="https://github.com/DiegoPrestamo/DiegoPrestamo.github.io/assets/103367642/24a16cac-a35a-4dc7-bdc4-a5e604a97dcd" width="800">
</p>
</div>

## Step 5: Basic controls of a default Poppy Humanoid
Now that we have loaded a Humanoid onto our simulator, it is time to control it.

Here is a simple script that moves various joints. These are the basic ways to control the arms.
```bash
from pypot.creatures import PoppyHumanoid

vrep_port = 19990 # your port will likely be 19997 since I specifically changed mine which I menioned earlier


poppy = PoppyHumanoid(simulator='vrep', port = vrep_port)

# right shoulder movement
poppy.r_shoulder_y.goto_position(-30, 0.5, wait=True) # right shoulder movement in y direction, time frame of 0.5 seconds, waits to get to position before proceeding
poppy.r_shoulder_x.goto_position(-60, 0.5, wait=True) # right shoulder movement in x direction
poppy.r_arm_z.goto_position(30, 0.5, wait=True) # right shoulder movement in z direction

# right arm movement
poppy.r_arm_z.goto_position(-30, 0.5, wait=True)
poppy.r_arm_z.goto_position(30, 0.5, wait=True)

# return to zero
poppy.r_shoulder_y.goto_position(0, 0.5, wait=True)
poppy.r_shoulder_x.goto_position(0, 0.5, wait=True)
poppy.r_arm_z.goto_position(0, 0.5, wait=True)

# left shoulder movement
poppy.l_shoulder_y.goto_position(-30, 0.5, wait=True)
poppy.l_shoulder_x.goto_position(60, 0.5, wait=True)
poppy.l_arm_z.goto_position(-30, 0.5, wait=True)

# left arm movement
poppy.l_arm_z.goto_position(-30, 0.5, wait=True)
poppy.l_arm_z.goto_position(30, 0.5, wait=True)

# return to zero
poppy.l_shoulder_y.goto_position(0, 0.5, wait=True)
poppy.l_shoulder_x.goto_position(0, 0.5, wait=True)
poppy.l_arm_z.goto_position(0, 0.5, wait=True)

#closes poppy communication
poppy.close()
```
And the movement should look something like this:

![GIF demonstration could not load!](https://i.imgur.com/eHOg7uk.gif)
Simulating through Python can take a couple of seconds, so don't panic if it does not run right away.

You now have a version of a Poppy Humanoid that you can control in quite a similar fashion to the real thing. Let us take this one step further.

## Controlling a specific Poppy Humanoid scene:
The problem with only using a default Poppy scene is that we cannot use a specific scene that we have modified unless we want to manually program everything into our script (which might be a legitimate alternative, just not one that I have explored). For example, if I want to attach a vision sensor to Poppy's forehead, I must create that in a scene, so loading a default every time will not help us.

## Step 1: Save a default Poppy scene as a specific '.ttt' file in a specific file path that you will keep handy for the next steps
![GIF demonstration could not load!](https://i.imgur.com/t2V503v.gif)

## Step 2: Get creative
Now you can add various peripherals and simulate them. Much cooler than a simple default Poppy. Let us add a vision sensor:
- Go to the Menu bar and click **Add**
- Under **Vision sensor** select **Perspective type**. The **Perspective type** vision sensor has a triangular field of view similar to our eyes, the **Orthographic type** projects in a rectangular fashion.
- Go to **Object/item position/orientation**. Under **Position/Translation** change the y-position to **-0.035 m**, the z-position to **0.8 m**, and leave the x-position alone. Then go to the **Orientation/Rotations** and change alpha to **90 deg**
![GIF demonstration could not load!](https://i.imgur.com/yydH6b3.gif)

#### Step 2.5: Connect the Vision Sensor to Poppy's head visual
If we do not do this step, it is as if the vision sensor and Poppy's head just happen to be at the same place at once. By dragging the vision sensor and dropping it to Poppy's **head_visiual** we are effectively connecting the vision sensor to the head like we would expect
![GIF demonstration could not load!](https://i.imgur.com/FnvzLlL.gif)
* Not shown: Change resolution to 1080 / 1080 or anything that is not the treacherous default 32 / 32
* Make sure to save your scene anytime you make changes or they will not show up next time you run the scene

## Step 3: Add a renderable object in the field of view:
Let us put something in front of the camera just to make sure we have everything working. We will add a cuboid and put it right in front of Poppy's face.
- Go to the Menu bar and click **Add**
- Select **Cuboid** under **Primitive shape**
- Use **Object position** controls to place the cuboid in Poppy's field of view
![image](https://github.com/DiegoPrestamo/DiegoPrestamo.github.io/assets/103367642/fe80be1b-e775-4f01-9cc8-87425f395b4a)

#### Step 3.5 Make sure the object is renderable and floating
Do not expect something to render on the vision sensor view (next step) if you did not make it renderable.
Under **Scene Object Properties** hit the **renderable** box:
<div align="center">
<p>
<img src="https://github.com/DiegoPrestamo/DiegoPrestamo.github.io/assets/103367642/1ceba361-8a78-45ad-a9a1-3647502161e1" width="800">
</p>
The **Scene Object Properties** is the magnifying glass which I drew the arrow to at the beginning
</div>

While you are at it, go to **Show dynamic properties dialog** and uncheck **Body is dynamic**. That way the cube will float instead of falling with gravity.
<p>
<img src="https://github.com/DiegoPrestamo/DiegoPrestamo.github.io/assets/103367642/9bc5fa5e-4d50-4a38-b55c-204b1ff8f7bf" width="800">
</p>

## Step 4: Insert a floating view and associate it with the vision sensor
It is nice to be able to see what the vision sensor is seeing. Let us add a floating view to do just that.
- Right click anywhere in the scene (another way to access the menu)
- Hover over to **Add** --> **Floating View**
- In the **Hierarchy** select your vision sensor
- Right click the floating view --> **view** --> **associate view with selected vision sensor**
- Run your scene and you should see what the vision sensor is seeing
![GIF demonstration could not load!](https://i.imgur.com/N5JSYmM.gif)

## Step 5: Copy and paste API files in our path
We will need to fetch three files from the V-REP file location and place them in the same path as our current scene
- Sim.py - Found in **_pycache_** file
- simConst.py - Found in **_pycache_** file
- remoteApi.dll - Found in **programming** --> **remoteApiBindings** --> **lib** --> **lib** --> choose 64 bit or 32 bit --> remoteApi.dll
<div align="center">
<p>
<img src="https://github.com/DiegoPrestamo/DiegoPrestamo.github.io/assets/103367642/c0dcdbae-4348-4bd2-9485-c19fd9980e18" width="800">
</p>
This is my path for the _poppy_humanoid_ file we are working with
</div>

## Step 6: Control this specific scene using a Python script
We have now created a specific scene which we would like to experiment with. We do not want to simply run a default scene. Let us write a Python script to communicate directly with the scene we have just created. The important lesson from this script is the manner in which we are communicating with V-REP.
```bash
from pypot.creatures import PoppyHumanoid
import time

# the path to where you have your Poppy scene saved... this is mine and yours should be different
scene_path = r"C:\Users\prest\OneDrive\Documents\Poppy Research\poppy_humanoid.ttt"

# the new way we will connect to V-REP
vrep_host = '127.0.0.1' # the IP address
vrep_port = 19990 # same port from earlier... again yours will probably be 1997
vrep_scene = scene_path

poppy = PoppyHumanoid(simulator='vrep', scene=vrep_scene, host=vrep_host, port=vrep_port)

# head movement to pan around scene
poppy.head_z.goal_position = 60
time.sleep(1)
poppy.head_z.goal_position = -60
time.sleep(1)
poppy.head_z.goal_position = 0
time.sleep(1)

poppy.close()
```
The behavior should look like this:
![GIF demonstration could not load!](https://i.imgur.com/SIfJufW.gif)

We have gone far. You should feel good about yourself. If you spot an error (typo, code, anything really) or are stuck on something shoot me an email through my **about** page. Keep building!








Loading