.
February 19, 2025
- Checked the OER of PsychoBiology on partial grades:
"Onvoldoende beoordeeld
praktisch werk kan worden herkanst voor maximaal een 6,0.".
January 29, 2025
- Made a replacement for saveImage based on ALPhotoCapture. Both jpg and png format works (looking under an angle looking at the door):
- Also tried the different resolution (from 320x480, 640x480, 1280x960 to 2560x1920).
- Yet all four have the same resolution. Maybe retry with HalfPressed on False. Taking pictures takes now much longer!
- But it was working, the four images have now different resolutions (checked with command file) :
- So, a nice peace of code, but it is not about the file, its about the Snapshot. Yet, nice piece of (obsolete) test-code (which only works when the capProxy is initiated in globals):
""" systematic test of several functions of this module """
def test_module_functions(self):
### January 2025 - Lets test the tools-module systematically
print("\nTesting some of the tools functions:\n")
### First test functionallity for a new implementation of SaveImage()
# http://doc.aldebaran.com/2-8/naoqi/vision/alphotocapture-api.html
try:
print('trying saveImage() with AlPhotoCapture service. ')
halfpress_status = self.globals.capProxy.isHalfPressEnabled()
print('By default, halfPressEnabled is: ', halfpress_status)
self.globals.capProxy.setHalfPressEnabled(False)
halfpress_status = self.globals.capProxy.isHalfPressEnabled()
print('Switched halfPressEnabled off, to allow to change resolution: ', halfpress_status)
# http://doc.aldebaran.com/2-8/family/nao_technical/video_naov6.html
self.globals.capProxy.setPictureFormat("png")
self.globals.capProxy.setResolution(1) # 320x240 pixels
self.globals.capProxy.takePicture("/tmp", "image_320_240")
self.globals.capProxy.setResolution(2) # 640x480 pixels
self.globals.capProxy.takePicture("/tmp", "image_640_480")
self.globals.capProxy.setResolution(3) # 1280x960 pixels
self.globals.capProxy.takePicture("/tmp", "image_1280_960")
self.globals.capProxy.setResolution(4) # 2560x1920 pixels
self.globals.capProxy.takePicture("/tmp", "image_2560_1920")
print('Finished with takePicture() from AlPhotoCapture service. ')
except:
print('saveImage() test failed. ')
- Yet, saveImage also requires another parameter, the actual shot. It seems that the specs have changed (different container specifications).
- The image doesn't have to be converted, the Nao supports multiple color-sspaces.
January 28, 2025
- Perry also has the python3.9 app installed.
- Made a scripts/set_python3_env.sh, which sets the right PATHs.
- Also modified scripts/runpy3.sh so that the LD_PRELOAD works.
- Tested on set_volume_70perc.py
- Moved into startcode part1 and executed runpy3.sh config.py, result; "Perry still alive!"
- Perry was needed for the current group.
- Ferb was back to yggdrasil, so wait on Perry.
- Working on the experimental version v8f. Renamed it to v9. Converted it with the option 2to3-3.9 -w (2to3-script is available in the same bin-directory as python3.9.
- Upgraded config_v9.py, framework/*.py.
- Next to update is main_v9.py. OpenCV was used to convert to HSV, but that was only one call (could be skipped).
- Next is globals_v9.py. Here I had to replace naoqi with import qi.
- Next is motion_v9.py and sonar_v9.py. sonar_v4 still contained both cv2 as naoqi, seems not needed. Import goes well, not sure about calls.
- Tools should be skipped, it contains several cv2 calls. Three functions cannot be used at the robot, including SaveImage().
- Also for vision_v9 only three functions had to be removed. behaviors_v2 is not loaded, so the framework starts.
- Current version crashes on:
File "/data/home/nao/scripts/Assignment 2_cv3_v9/config_v9.py", line 36, in
mframework.startUpFramework(moduledict, VERBOSE)
File "/data/home/nao/scripts/Assignment 2_cv3_v9/framework/mframework.py", line 49, in startUpFramework
modules.getMainModule().start()
File "/data/home/nao/scripts/Assignment 2_cv3_v9/modules/main/main_v9.py", line 58, in start
last_image, (camPos, headAngles) = self.tools.getSnapshot()
File "/data/home/nao/scripts/Assignment 2_cv3_v9/modules/lib/tools_v9.py", line 111, in getSnapshot
frame = data_npyarr.reshape((h,w,3))
ValueError: cannot reshape array of size 439891 into shape (240,320,3)
- Removed getSnapshot() and SaveImage(), Perry walked 0.5m.
- Mode a first test for one of the motion-functions. Maybe it is even better to put the tests in the motion-model itself
- Finished the second test (named the previous version main_v8.py), for changeHead:
Python3.9 running main_v9 with NaoQi 2.8.7.4
Testing some of the motion functions:
The current autonomous abilities status:
{'name': 'AutonomousBlinking', 'enabled': False, 'running': False}
{'name': 'BackgroundMovement', 'enabled': True, 'running': True}
{'name': 'BasicAwareness', 'enabled': False, 'running': False}
{'name': 'ListeningMovement', 'enabled': False, 'running': False}
{'name': 'SpeakingMovement', 'enabled': False, 'running': False}
Changing the BackgroundMovement to False
The updated autonomous abilities status:
{'name': 'BackgroundMovement', 'enabled': False, 'running': False}
Changing the Background movement back to the default True
The updated autonomous abilities status:
{'name': 'BackgroundMovement', 'enabled': True, 'running': True}
Testing the next motion function:
The current angles of (HeadYaw,HeadPitch):
[0.5828781127929688, 0.5491299629211426]
The current stiffness of (HeadYaw, HeadPitch):
[0.0, 0.0]
Setting (HeadYaw, HeadPitch) to an absolute position (0.2,-0.2):
The current stiffness of the (HeadYaw,HeadPitch):
[0.6000000238418579, 0.6000000238418579]
The current angles of (HeadYaw,HeadPitch):
[0.21471810340881348, -0.16264605522155762]
changeHead with vector (0.0,0.0):
The current angles of (HeadYaw,HeadPitch):
[0.21471810340881348, -0.16264605522155762]
changeHead with vector (+0.1,-0.1):
The updated angles of (HeadYaw,HeadPitch):
[0.28374814987182617, -0.21173405647277832]
changeHead back with vector (-0.1,+0.1):
The updated angles of (HeadYaw,HeadPitch):
[0.21471810340881348, -0.1104898452758789]
Ready with testing some of the motion functions!
.
- Change the Pitch is difficult against gravity (Perry was in gorilla-pose).
January 27, 2025
- One team reported that sometimes the camera-head movement calls for a SetStiffness, which crashes on no module found (but not always). Haven't heard of this error before.
January 23, 2025
- Read the 12th and last chapter of Arkin's Governing Lethal Behavior in Autonomous Robots (2009). An implementation of the Ethical Govener by two Georgia Tech students. Very propositional logic based, together with some classic Window popups (Permission To Fire: Denied
- A book far ahead of its time, but also already a bit outdated and more based on the AuRA architicture than on purily behavior-based architecture.
January 22, 2025
January 20, 2025
- Read the 10th chapter of Arkin's Governing Lethal Behavior in Autonomous Robots (2009). Goes into the details of the Ethical Governor, Ethical Behavior Control, Ethical Adapter and Responsibility Advisor. The third option reviews post-operation the action, and improve the behavior based on guilt and regret. The fourth option is HCI component, which informs the users what is ethical possible and impossible.
- The Ethical Adapter also has affective restriction which adjust during run-time the tresholds based on emotions like Anger (lower), Shame (higher), Compasion, Gratitude.
January 17, 2025
January 16, 2025
January 15, 2025
January 14, 2025
- There was some installation issues under Windows with one of the students.
- Checked my op PYTHONPATH setting, which is actually C:\Packages\pynaoqi-2.8.7.4\lib.
- I don't have python2 in my path, but a python 2.7.16 can be found in C:\Packages\pynaoqi-2.8.7.4\bin.
- When I try to import numpy, I get a warning from C:\Programs\Anaconda2\lib\site-packages\numpy: DLL load failed.
- Trying .\python -m pip install numpy, which fails because the Anaconda-version is already installed.
- Looking up version with .\python -m pip install numpy== and installed .\python -m pip install numpy==1.16.6 (upgrade from 1.16.5)
- Same happened with matplotlib, upgraded from version 2.2.3 to 2.2.5.
- Same for opencv, upgraded from version 4.2.0.32 to 4.3.0.38. There something go wrong with the Anaconda environment. Yet, version 4.1.2.30 could be installed.
- Also .\python -m pip install opencv-contrib-python==4.1.2.30 worked.
- Everything works, except import matplotlib (which still uses Anaconda's version).
- Yet, matplotlib is not needed, could start config_v8.py from Assignment 2. (will test the connection with Appa).
- Works fine, no warnings, 9 images saved, walked, sit, rest.
January 10, 2025
- Read the third chapter of Arkin's Governing Lethal Behavior in Autonomous Robots (2009).
- Ferb was flashed back to yggdrasil. Flashing back to NaoQi.
- Added Python3 (v1.2.3) to Ferb via Aldebaran cloud
- According to Manage Robot, Python3 is installed, although it cannot be found in /home/nao/.local/share/PackageManager/apps/python3nao/. Trying a reboot.
- Going into Updates from RobotSetting. There are now 40 Updates ready to be downloaded, although I don't see Python3 in this list. Uninstalled and installed Python3 again from the cloud and Updated in RobotSettings. v1.2.2 is installed.
- Going into my Ubuntu22.04 WSL terminal. Did python3 -m pip install qi.
- Tested the installation with set_volume_70perc.py. Had to change from naoqi import qi to import qi, but than it worked.
- Also tried to run record_top_bottom.py, which gives a warning qi.path.sdklayout: No Application was created, trying to deduce paths, followed with a DepreciationWarning DeprecationWarning: The binary mode of fromstring is deprecated, as it behaves surprisingly on unicode inputs. Use frombuffer instead (line 70), followed by an error: cannot reshape array of size 754201 into shape (240,320,3).
- Made a record_bottom.py script, which records from the MultiStream both images, but for the single image always records the bottom image. At least cv2 and numpy are working fine, next try build a python3 version of day1 (and day3).
- Read the fourth and fifth chapter of Arkin's Governing Lethal Behavior in Autonomous Robots (2009).
- The sixth chapter of Arkin's Governing Lethal Behavior in Autonomous Robots (2009) defines a simple formal model, consisting of the tuple (stimulus, behavioral mapping, response). The response has both a direction and strength. Unethical responses can be suppressed by an Ethical Governer, adjusted by an Ethical Adapter or guaranteed to be generated by an Ethical Behavioral Control. Anyway, Arkin's 98 book is heavily cited.
-
- Looking how difficult it is to convert dag1_startcode to python3.
- The framework goes already wrong on its print statements. Installed python3-tables, still py2to3 doesn't work. Instead installed 2to3. Running 2to3 -w mframework.py worked. Next mloader.py
- Now running the config.py fails on modules.getMainModule().start(), which is explained in InstructionsQuest1 Made main.py
- Made a first version of startcode part1 for python3. Could say "Hello World" / "Ferb still alive!"
- Only don't like the warning qi.path.sdklayout: No Application was created, trying to deduce paths and I like to start the application in a separate function (not setProxies).
- Looking into the qi.path documentation.
- Made a secibd version of startcode part1 for python3. Adding an app.run() didn't help for the path-warning. Could still say "Ferb still alive!" with the app.start in the main.
January 9, 2025
January 6, 2025
- Want to the Nao-shaped USB-stick with tag 'flash NaoQi 2.8.7.4' to flash Perry.
- First updating Perusall, copying last year's course and going to the five steps of Getting Started.
- In the 3rd step, Robot Programming: A Practical Guide to Behavior-Based Robotics from Joseph Jones showed up, although the publisher didn't gave permission to use the book in Perusall.
- A book that can be accessed on request (for two weeks), is Arkin's Governing Lethal Behavior in Autonomous Robots from 2009.
- Updated the dates of the assignments to this year, seems to work.
-
- Looked again at the cloud-management from Aldebaran, and Moos still reports NaoQi v2.8.7.4, which is also the most recent version available.
- Checked the Nao6 software downloads. For Windows the latest version of Chorégraphe is 2.8.7, for Mac and Linux version 2.8.8 is available.
- Yet, what I need is the SDK. There the latest version is 2.8.6 for Mac and Linux, and 2.8.7 for Windows. So, the software on Canvas is still state-of-the-art. The page also gives the universal Softbank license: 654e-4564-153c-6518-2f44-7562-206e-4c60-5f47-5f45
- Flashed Perry with the Nao-shaped USB-stick with tag 'flash NaoQi 2.8.7.4'.
- Started Choregraphe 2.8.6.23 and connected with ethernet cable. That didn't work with the Black Dell ring, but fine with the Grey one.
- Again, back to Factory settings, but the webinterface was stuck in the network wizard.
- Logged in via ssh, and registered the MAC address in iotroam.
- Configured the Network with RobotSettings. Used the advanced/#/settings to permit deactivation of the safety reflexes.
- Tai-Chi worked nicely on Perry.
-
- Actually, I can install Python 3 for Nao on Perry.
- Documentation seems to be wibbly wobbly.
- According to Nao Classroom, there is Python3.5 running on the robot, including qi. Maybe something to ask from the BscKI students.
- Another option is to use ROS for Nao.
- The one installed is probably 1.2.2 Beta. Choregraphe indeed says 1.2.2.
- Started the script from /home/nao/.local/share/PackageManager/apps/python3nao/bin/ on the nao.
- That starts python3.9, which is also on that directory.
- From there, import qi works.
- Next, I try ALTextToSpeech example
- Running ~/.local/share/PackageManager/apps/python3nao/bin/runpy3.sh altexttospeech_say.py from an examples directory worked.
- The only reference in the environment on the nao to python is PYTHONPATH=/opt/aldebaran/lib/python2.7/site-packages. So, updating the PATH and PYTHONPATH should allow to use python3.9 and the qi-libraries. Yet, not sure if this includes OpenCV. Also matplotlib and scipy are missing.
- Looking for where the PYTHONPATH is set. No /home/nao/.bashrc. Yet, in /etc/profile.d/nao.sh there is the script that should be in /home/nao/.profile. That points to /etc/conf.d/naoqi, which defines PYTHON_PATH, LD_LIBRARY_PATH and three QI_ variables. Note that the LD_LIBRARY_PATH also points to /opt/ros/indigo/lib
- Without changing something on the environment, went to ~/.local/share/PackageManager/apps/python3nao/bin and did ./python3.9 -m pip install scipy. That tried to install scipy-1.13.1, but failed on numpy when trying to build the wheel with gcc.
- The command ./python3.9 -m pip install --upgrade pip worked. (upgrading from 22.0.3 to 24.3.1).
- In principal numpy should already be part of the package. ./runpy3.sh -m pip list indicates numpy 1.25.2.
- The command ./runpy3.sh -m pip index versions scipy gives a list of versions (latest 1.13.1).
- For scipy-1.12 it tries to compile numpy 1.22.4. For scipy-1.13.1 it tries numpy-2.0.2 (because of a rule numpy<2.3,>=2.0.0rc1). For scipy-1.13.0 it also tries numpy-2.0.2.
- Tried also ./runpy3.sh -m pip install matplotlib, which also fails on numpy-2.0.2.
- So, the only option is to try to it from the laptop side.
-
- Next to flash is Appa. Also switched the safety reflex off. Tai-Chi was OK.
- Next to flash is Ferb. According to the board, it has problems with the left leg. No problems with Tai-Chi, although it complained a lot about its sensors (after reboot it was gone). Also let him walk. On a hard surface (ASML board) it worked nicely, on the grass it had more problems with its balance.
- Next to flash is Barbie. Had to add the MAC-address to iotroam. Also switched the safety reflex off. Tai-Chi was OK.
-
Previous Labbooks