Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add the possibility to run the SkinRetargeting NN online #113

Open
wants to merge 21 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
21 commits
Select commit Hold shift + click to select a range
bee3b10
Add parameter to add offsets on the human hand motion range
lrapetti Oct 8, 2022
396fa6f
Update configuration file
lrapetti Oct 9, 2022
06b9743
Add robot_to_human map parameter
lrapetti Oct 9, 2022
de2e127
Add timer to disable a finger if a taxel is activated for long time
lrapetti Oct 8, 2022
dad93ce
Test CNN for skin
GiulioRomualdi Oct 9, 2022
6de390f
enable the vibration when the palm is active
GiulioRomualdi Oct 9, 2022
4379fd6
Fix several bugs
GiulioRomualdi Oct 9, 2022
d3dd5a2
Minor changes on the vibrotactile
GiulioRomualdi Oct 9, 2022
c8e3ca2
Update Finger feedback vibration reset strategy
Oct 9, 2022
70973a2
Add temporary files before shipping the robot
GiulioRomualdi Oct 9, 2022
971048b
Bugfix in RobotSkin::getPalmSkinMatrix()
GiulioRomualdi Oct 24, 2022
b775a1d
Add the possibility to get the calibrated skin in RobotSkin class
GiulioRomualdi Oct 20, 2022
0e00cd9
Use alexnet32_25ep for inference
GiulioRomualdi Oct 31, 2022
5dcf15b
Restore finger tactile long contact logic accordingly to LP
GiulioRomualdi Oct 31, 2022
6a5e515
fix calibartion skin
Nov 4, 2022
07a22f1
Remove fingertip actuation
RiccardoGrieco Nov 4, 2022
a5a03f0
Avoid robot calibration
RiccardoGrieco Nov 4, 2022
e1d2b56
Install nlohmann json in GitHub CI
GiulioRomualdi Jan 19, 2023
e3920a2
Clean the code related to the rock roughness detection.
GiulioRomualdi Jan 19, 2023
0f279e4
Use robotology-superbuild-dependencies-vcpk in GitHub CI
GiulioRomualdi Jan 19, 2023
75d2f6d
Avoid to use integer as default value of a boolean variable in RobotS…
GiulioRomualdi Jan 19, 2023
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
19 changes: 15 additions & 4 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,11 @@ on:
# Execute a "nightly" build at 2 AM UTC
- cron: '0 2 * * *'

env:
vcpkg_robotology_TAG: v0.10.1

# Overwrite the VCPKG_INSTALLATION_ROOT env variable defined by GitHub Actions to point to our vcpkg
VCPKG_INSTALLATION_ROOT: C:\robotology\vcpkg

jobs:
build:
Expand Down Expand Up @@ -40,21 +45,27 @@ jobs:
- name: Dependencies [Windows]
if: matrix.os == 'windows-latest'
run: |
git clone https://github.com/robotology-dependencies/robotology-vcpkg-binary-ports C:/robotology-vcpkg-binary-ports
vcpkg.exe --overlay-ports=C:/robotology-vcpkg-binary-ports install --triplet x64-windows ace libxml2 eigen3 ipopt-binary catch2
# To avoid spending a huge time compiling vcpkg dependencies, we download a root that comes precompiled with all the ports that we need
choco install -y wget unzip
# To avoid problems with non-relocatable packages, we unzip the archive exactly in the same C:/robotology/vcpkg
# that has been used to create the pre-compiled archive
cd C:/
wget https://github.com/robotology/robotology-superbuild-dependencies-vcpkg/releases/download/${env:vcpkg_robotology_TAG}/vcpkg-robotology-with-gazebo.zip
unzip vcpkg-robotology-with-gazebo.zip -d C:/
rm vcpkg-robotology-with-gazebo.zip

- name: Dependencies [macOS]
if: matrix.os == 'macOS-latest'
run: |
brew install ace boost eigen swig qt5 orocos-kdl catch2
brew install ace boost eigen swig qt5 orocos-kdl catch2 nlohmann-json

- name: Dependencies [Ubuntu]
if: matrix.os == 'ubuntu-latest'
run: |
sudo apt-get update
sudo apt-get install git build-essential cmake libace-dev coinor-libipopt-dev libboost-system-dev libboost-filesystem-dev \
libboost-thread-dev liborocos-kdl-dev libeigen3-dev swig qtbase5-dev qtdeclarative5-dev qtmultimedia5-dev \
libxml2-dev liburdfdom-dev libtinyxml-dev liburdfdom-dev liboctave-dev python3-dev valgrind
libxml2-dev liburdfdom-dev libtinyxml-dev liburdfdom-dev liboctave-dev python3-dev valgrind nlohmann-json3-dev

- name: Source-based Dependencies [Windows]
if: matrix.os == 'windows-latest'
Expand Down
5 changes: 5 additions & 0 deletions app/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -25,5 +25,10 @@ foreach (dir ${subdirs})
yarp_install(FILES ${scripts} DESTINATION ${YARP_ROBOTS_INSTALL_DIR}/${dir})
endforeach ()

foreach (dir ${subdirs})
file(GLOB scripts robots/${dir}/*.json)
yarp_install(FILES ${scripts} DESTINATION ${YARP_ROBOTS_INSTALL_DIR}/${dir})
endforeach ()

file(GLOB scripts scripts/*.xml)
yarp_install(FILES ${scripts} DESTINATION ${YARP_APPLICATIONS_INSTALL_DIR})
31 changes: 31 additions & 0 deletions app/robots/iCubGenova09/hapticGloveConfig_rightHand.ini
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
name HapticGloveRetargeting


[GENERAL]
robot icub
samplingTime 0.01
enableMoveRobot 1
enableLogger 0
useLeftHand 0
useRightHand 1
isMandatory 0
useSkin 1
#calibrationTimePeriod [sec]
calibrationTimePeriod 8.0
#robotInitializationTime [sec]
robotInitializationTime 3.0
getHumanMotionRange 1
# the counter to check if steady state is reached [steps]
steadyStateCounterThreshold 5
# the threshold to check the error between the desired and feedback values for the steady state check [rad]
steadyStateThreshold 0.05
# the time teleoperation should wait before running [sec]
waitingDurationTime 5.0
# threshold in which an skin is considered as working fine [no units]
tactileWorkingThreshold 0.0001
# threshold in which an skin data is considered updated [no units]
tactileUpdateThreshold -1.0

# include fingers parameters
[include LEFT_FINGERS_RETARGETING "leftFingersHapticRetargetingParams.ini"]
[include RIGHT_FINGERS_RETARGETING "rightFingersHapticRetargetingParams.ini"]
47 changes: 41 additions & 6 deletions app/robots/iCubGenova09/leftFingersHapticRetargetingParams.ini
Original file line number Diff line number Diff line change
@@ -1,11 +1,14 @@
###############
### ROBOT
###############
remote_control_boards ("left_arm")
remote_control_boards ("left_arm")

remote_sensor_boards "left_hand"
remote_sensor_boards "left_hand"

axis_list ( "l_hand_finger", "l_thumb_oppose", "l_thumb_proximal", "l_thumb_distal", "l_index_proximal", "l_index_distal", "l_middle_proximal", "l_middle_distal", "l_pinky" )
connect_to_calibrated_skin 1
remote_calibrated_sensor_board "left_hand_filtered"

axis_list ( "l_thumb_oppose", "l_thumb_proximal", "l_thumb_distal", "l_index_proximal", "l_index_distal", "l_middle_proximal", "l_middle_distal", "l_pinky" )

all_axis_list ( "l_hand_finger", "l_thumb_oppose", "l_thumb_proximal", "l_thumb_distal", "l_index_proximal", "l_index_distal", "l_middle_proximal", "l_middle_distal", "l_pinky" )

Expand All @@ -21,8 +24,8 @@ joint_list ( "l_thumb_oppose", "l_thumb_proximal", "l_thumb_m

# the custom axes home angle value [degrees]
# By default it home values are set to min axis values
# axis-name , axis value
axes_custom_home_angle ( ( "l_thumb_oppose" , 30) )
# axis-name , axis value
# axes_custom_home_angle ( ( ${AXES_NAME} , ${VAL}) )

# if a joint is not listed here, the sensory information is of encoder type.
# notice that "l_thumb_oppose" and "l_hand_fingers" is measured by joint encoders not the analog sensors
Expand Down Expand Up @@ -64,12 +67,34 @@ wearable_data_actuator_ports_out "/WearableData/HapticGlove/LeftHand/Actuators/i

wearable_data_actuator_ports_in "/WearableData/HapticGlove/LeftHand/Actuators/input:i"

# delta on human finger joint motion range
motion_range_min_delta ( ( "l_thumb_oppose" , -30) )

###############
### RETARGETING
###############

motorsJointsCoupled 1

# motion retargetin
# motion retargetin
robot_to_human_map ( ("l_thumb_oppose", "l_thumb_oppose")
("l_thumb_proximal", "l_thumb_proximal")
("l_thumb_distal", "l_thumb_distal" )
("l_thumb_middle", "l_thumb_middle" )
("l_index_proximal", "l_index_proximal")
("l_index_distal", "l_index_distal")
("l_index_middle", "l_index_middle")
("l_middle_proximal", "l_middle_proximal")
("l_middle_distal", "l_middle_distal")
("l_middle_middle", "l_middle_middle")
("l_ring_proximal", "l_ring_proximal")
("l_ring_distal", "l_ring_distal")
("l_ring_middle", "l_ring_middle")
("l_pinky_proximal", "l_pinky_proximal")
("l_pinky_distal", "l_pinky_distal")
("l_pinky_middle", "l_pinky_middle") )

# haptic feedback retargeting from the robot axis groups to the human finger
l_thumb_finger ( "l_thumb_oppose", "l_thumb_proximal", "l_thumb_distal" )
l_index_finger ( "l_hand_finger", "l_index_proximal", "l_index_distal" )
Expand Down Expand Up @@ -127,7 +152,7 @@ axesJointsCoupled 1

# in case a calibration phase necessary before starting teleoperating the robot,
# otherwise read the calibration matrix from the config file
doCalibration 1
doCalibration 0
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@RiccardoGrieco @lrapetti do you remember why this modification was necessary?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

As far as I remember this should be a last-minute modification when we tried to remove the haptic force feedback. I would probably discard this change. (this code is not the one that is currently used in the robot right?)


#robot controller exponential filter gain
exponentialFilterGain 0.9
Expand Down Expand Up @@ -177,6 +202,16 @@ l_middle_finger_tactile_info ( 12 23
l_ring_finger_tactile_info ( 24 35 0.14 1.0 200.0 0.5 3.0 40.0)
l_little_finger_tactile_info ( 36 47 0.14 1.0 200.0 0.5 3.0 40.0)


net_model_name "left_palm_model_alexnet32_25ep.json"
use_calibrated_skin_for_palm 1
palm_skin_index_offset 96
number_of_palm_skin_taxels 48
palm_skin_activation_norm_raw 1630
palm_skin_activation_norm_calibrated 15
palm_skin_mapping ((29 0 0), (28 0 1), (30 0 2), (31 0 3), (33 0 4), (27 1 1), (26 1 2), (32 1 3), (34 1 4), (35 2 2), (25 2 3), (24 2 4), (6 0 5), (7 0 6), (8 0 7), (9 0 8), (10 0 9), (11 0 10), (3 1 5), (1 1 6), (4 1 7), (5 1 8), (2 2 5), (0 2 6), (17 2 7), (20 2 8), (21 2 9), (15 3 5), (14 3 6), (16 3 7), (19 3 8), (13 4 7), (18 4 8), (22 3 9), (12 4 9), (23 5 8), (45 5 5), (42 5 6), (36 5 7), (44 6 5), (40 6 6), (38 6 7), (37 6 8), (41 7 6), (39 7 7), (43 8 6), (47 4 6), (46 4 5))


# absolute vibrotactile feedback nonlinear function parameters
# 15.0 * std::log(2 * std::pow(x, 0.7) + 1) + 0.5 * std::pow(x, 1.1);
# reference to https://github.com/ami-iit/element_retargeting-from-human/issues/182#issuecomment-1000472012
Expand Down

Large diffs are not rendered by default.

31 changes: 28 additions & 3 deletions app/robots/iCubGenova09/rightFingersHapticRetargetingParams.ini
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,8 @@ joint_list ( "r_thumb_oppose", "r_thumb_proximal", "r_thumb_midd

# the custom axes home angle value [degrees]
# By default it home values are set to min axis values
# axis-name , axis value
axes_custom_home_angle ( ( "r_thumb_oppose" , 30) )
# axis-name , axis value
# axes_custom_home_angle ( ( ${AXES_NAME} , ${VAL}) )

# if a joint is not listed here, the sensory information is of encoder type.
# notice that "r_thumb_oppose" and "r_hand_finger" is measured by joint encoders not the analog sensors
Expand Down Expand Up @@ -64,12 +64,34 @@ wearable_data_actuator_ports_out "/WearableData/HapticGlove/RightHand/Actuators/

wearable_data_actuator_ports_in "/WearableData/HapticGlove/RightHand/Actuators/input:i"

# delta on human finger joint motion range
motion_range_min_delta ( ( "r_thumb_oppose" , 30) )

###############
### RETARGETING
###############

motorsJointsCoupled 1

# motion retargetin
robot_to_human_map ( ("r_thumb_oppose", "r_thumb_oppose")
("r_thumb_proximal", "r_thumb_proximal")
("r_thumb_distal", "r_thumb_distal" )
("r_thumb_middle", "r_thumb_middle" )
("r_index_proximal", "r_index_proximal")
("r_index_distal", "r_index_distal")
("r_index_middle", "r_index_middle")
("r_middle_proximal", "r_index_proximal")
("r_middle_distal", "r_index_distal")
("r_middle_middle", "r_index_middle")
("r_ring_proximal", "r_ring_proximal")
("r_ring_distal", "r_ring_distal")
("r_ring_middle", "r_ring_middle")
("r_pinky_proximal", "r_pinky_proximal")
("r_pinky_distal", "r_pinky_distal")
("r_pinky_middle", "r_pinky_middle") )


# haptic feedback retargeting from the robot axis groups to the human finger
r_thumb_finger ( "r_thumb_oppose", "r_thumb_proximal", "r_thumb_distal" )
r_index_finger ( "r_hand_finger", "r_index_proximal", "r_index-distal" )
Expand Down Expand Up @@ -123,7 +145,7 @@ analog_sensors_raw_max_boundary ( 25.0 0.0 37.0 15.0 24.0 12.0 0.0
# in case each joint does not have independant motor to actuate, they are coupled
axesJointsCoupled 1

doCalibration 1
doCalibration 0
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Same here


#robot controller exponential filter gain
exponentialFilterGain 0.9
Expand Down Expand Up @@ -174,6 +196,9 @@ r_middle_finger_tactile_info ( 12 23
r_ring_finger_tactile_info ( 24 35 0.14 1.0 200.0 0.5 3.0 40.0)
r_little_finger_tactile_info ( 36 47 0.14 1.0 200.0 0.5 3.0 40.0)




# absolute vibrotactile feedback nonlinear function parameters
# 15.0 * std::log(2 * std::pow(x, 0.7) + 1) + 0.5 * std::pow(x, 1.1);
# reference to https://github.com/ami-iit/element_retargeting-from-human/issues/182#issuecomment-1000472012
Expand Down
Loading