Skip to content

Commit

Permalink
Merge pull request #99 from robotology/devel
Browse files Browse the repository at this point in the history
Merge devel into master
  • Loading branch information
S-Dafarra authored May 27, 2022
2 parents 916ae1b + 3b48a8a commit 28c685a
Show file tree
Hide file tree
Showing 100 changed files with 12,378 additions and 459 deletions.
35 changes: 28 additions & 7 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -88,24 +88,35 @@ jobs:
cd ${GITHUB_WORKSPACE}
git clone https://github.com/robotology/iDynTree
cd iDynTree
git checkout devel
mkdir -p build
cd build
cmake -A x64 -DCMAKE_TOOLCHAIN_FILE=${VCPKG_INSTALLATION_ROOT}/scripts/buildsystems/vcpkg.cmake \
-DCMAKE_PREFIX_PATH=${GITHUB_WORKSPACE}/install \
-DCMAKE_BUILD_TYPE=${{ matrix.build_type }} \
-DCMAKE_INSTALL_PREFIX=${GITHUB_WORKSPACE}/install ..
cmake --build . --config ${{ matrix.build_type }} --target install
# icub-main
cd ${GITHUB_WORKSPACE}
git clone https://github.com/robotology/icub-main.git --depth 1 --branch devel
git clone https://github.com/robotology/icub-main.git
cd icub-main && mkdir -p build && cd build
cmake -DCMAKE_PREFIX_PATH=${GITHUB_WORKSPACE}/install -DCMAKE_INSTALL_PREFIX=${GITHUB_WORKSPACE}/install -DCMAKE_BUILD_TYPE=${{ matrix.build_type }} \
cmake -A x64 -DCMAKE_PREFIX_PATH=${GITHUB_WORKSPACE}/install -DCMAKE_INSTALL_PREFIX=${GITHUB_WORKSPACE}/install -DCMAKE_BUILD_TYPE=${{ matrix.build_type }} \
-DENABLE_icubmod_cartesiancontrollerserver=ON -DENABLE_icubmod_cartesiancontrollerclient=ON -DENABLE_icubmod_gazecontrollerclient=ON ..
cmake --build . --config ${{ matrix.build_type }} --target install
# wearables
cd ${GITHUB_WORKSPACE}
git clone https://github.com/robotology/wearables.git
cd wearables
mkdir -p build
cd build
cmake -A x64 -DCMAKE_TOOLCHAIN_FILE=${VCPKG_INSTALLATION_ROOT}/scripts/buildsystems/vcpkg.cmake \
-DCMAKE_PREFIX_PATH=${GITHUB_WORKSPACE}/install \
-DCMAKE_BUILD_TYPE=${{ matrix.build_type }} \
-DXSENS_MVN_USE_SDK:BOOL=OFF \
-DCMAKE_INSTALL_PREFIX=${GITHUB_WORKSPACE}/install ..
cmake --build . --config ${{ matrix.build_type }} --target install
- name: Source-based Dependencies [Ubuntu/macOS]
if: matrix.os == 'ubuntu-latest' || matrix.os == 'macOS-latest'
Expand Down Expand Up @@ -133,7 +144,6 @@ jobs:
cd ${GITHUB_WORKSPACE}
git clone https://github.com/robotology/iDynTree
cd iDynTree
git checkout devel
mkdir -p build
cd build
cmake -DCMAKE_PREFIX_PATH=${GITHUB_WORKSPACE}/install -DCMAKE_BUILD_TYPE=${{ matrix.build_type }} \
Expand All @@ -142,12 +152,23 @@ jobs:
# icub-main
cd ${GITHUB_WORKSPACE}
git clone https://github.com/robotology/icub-main.git --depth 1 --branch devel
git clone https://github.com/robotology/icub-main.git
cd icub-main && mkdir -p build && cd build
cmake -DCMAKE_PREFIX_PATH=${GITHUB_WORKSPACE}/install -DCMAKE_INSTALL_PREFIX=${GITHUB_WORKSPACE}/install -DCMAKE_BUILD_TYPE=${{ matrix.build_type }} \
-DENABLE_icubmod_cartesiancontrollerserver=ON -DENABLE_icubmod_cartesiancontrollerclient=ON -DENABLE_icubmod_gazecontrollerclient=ON ..
cmake --build . --config ${{ matrix.build_type }} --target install
# wearables
cd ${GITHUB_WORKSPACE}
git clone https://github.com/robotology/wearables.git
cd wearables
mkdir -p build
cd build
cmake -DCMAKE_PREFIX_PATH=${GITHUB_WORKSPACE}/install \
-DCMAKE_BUILD_TYPE=${{ matrix.build_type }} \
-DCMAKE_INSTALL_PREFIX=${GITHUB_WORKSPACE}/install ..
cmake --build . --config ${{ matrix.build_type }} --target install
# ===================
# CMAKE-BASED PROJECT
Expand All @@ -171,7 +192,7 @@ jobs:
mkdir -p build
cd build
cmake -DCMAKE_PREFIX_PATH=${GITHUB_WORKSPACE}/install \
-DCMAKE_INSTALL_PREFIX=${GITHUB_WORKSPACE}/install ..
-DCMAKE_BUILD_TYPE=${{ matrix.build_type }} -DCMAKE_INSTALL_PREFIX=${GITHUB_WORKSPACE}/install ..
- name: Build
shell: bash
Expand Down
11 changes: 9 additions & 2 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -6,12 +6,19 @@ cmake_minimum_required(VERSION 3.5)
set(CMAKE_CXX_STANDARD 14)

project(walking-teleoperation
VERSION 1.2.0)
VERSION 1.3.0)

list(APPEND CMAKE_MODULE_PATH ${CMAKE_CURRENT_SOURCE_DIR}/cmake)

include(WalkingTeleoperationFindDependencies)

include(FindPackageHandleStandardArgs)
if(WIN32)
# MSVC standard library doesn't include things like M_PI_2 without this
add_definitions(-D_USE_MATH_DEFINES)
endif()



add_subdirectory(modules)
add_subdirectory(app)

Expand Down
4 changes: 0 additions & 4 deletions CybSDK_Config.ini

This file was deleted.

18 changes: 18 additions & 0 deletions app/robots/iCubErzelli02/XsensRetargetingWalking.ini
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
name XsensRetargeting
samplingTime 0.01
robot icub
# if the following is enabled we will use smoothing with smoothingTime value (default is true)
useSmoothing 0
smoothingTime 0.25
# The max difference (threshold) of a joint value coming from the human (rad)
jointDifferenceThreshold 0.5
wholeBodyJointsPort /HumanStateWrapper/state:i
controllerJointsPort /jointPosition:o
controllerCoMPort /CoM:o

# ROBOT JOINT LIST (Notice the order of the joint list is not wrong)
# Indeed they are written according to the joint order of the walking-coordinator
joints_list ("neck_pitch", "neck_roll", "neck_yaw",
"torso_pitch", "torso_roll", "torso_yaw",
"l_shoulder_pitch", "l_shoulder_roll", "l_shoulder_yaw", "l_elbow", "l_wrist_prosup", "l_wrist_pitch", "l_wrist_yaw",
"r_shoulder_pitch", "r_shoulder_roll", "r_shoulder_yaw", "r_elbow", "r_wrist_prosup", "r_wrist_pitch", "r_wrist_yaw")
19 changes: 19 additions & 0 deletions app/robots/iCubErzelli02/XsensRetargetingYoga.ini
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
name XsensRetargeting
samplingTime 0.01
robot icub
# if the following is enabled we will use smoothing with smoothingTime value (default is true)
useSmoothing 1
smoothingTime 0.25
# The max difference (threshold) of a joint value coming from the human (rad)
jointDifferenceThreshold 0.5
wholeBodyJointsPort /HumanStateWrapper/state:i
controllerJointsPort /jointPosition:o
controllerCoMPort /CoM:o

# ROBOT JOINT LIST (Notice the order of the joint list is not wrong)
# Indeed they are written according to the joint order of the yoga-retargeting
joints_list ( "torso_pitch", "torso_roll", "torso_yaw",
"l_shoulder_pitch", "l_shoulder_roll", "l_shoulder_yaw", "l_elbow",
"r_shoulder_pitch", "r_shoulder_roll", "r_shoulder_yaw", "r_elbow",
"l_hip_pitch", "l_hip_roll", "l_hip_yaw", "l_knee", "l_ankle_pitch", "l_ankle_roll",
"r_hip_pitch", "r_hip_roll", "r_hip_yaw", "r_knee", "r_ankle_pitch", "r_ankle_roll")
14 changes: 14 additions & 0 deletions app/robots/iCubErzelli02/faceExpressionsConfig.ini
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
# The name of the module
name face_expressions_from_mic

# The audio input port. Connect to this port the source to be used to trigger the face expressions.
audio_input_port_name /in

# The emotions output port. Connect this port to the emotion interface input port.
emotions_output_port_name /emotions:o

# The module period. In any case, it depends on the frequency of the input port.
period 0.01

# It controls the frequency with which the robot opens and close the mouth.
expression_counter_max_value 2
25 changes: 25 additions & 0 deletions app/robots/iCubErzelli02/hapticGloveConfig.ini
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
name HapticGloveRetargeting


[GENERAL]
robot icub
samplingTime 0.01
enableMoveRobot 1
enableLogger 1
useLeftHand 1
useRightHand 1
smoothingTime 0.25
isMandatory 0
#calibrationTimePeriod [sec]
calibrationTimePeriod 2.0
#robotInitializationTime [sec]
robotInitializationTime 10.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

# include fingers parameters
[include LEFT_FINGERS_RETARGETING "leftFingersHapticRetargetingParams.ini"]
[include RIGHT_FINGERS_RETARGETING "rightFingersHapticRetargetingParams.ini"]
8 changes: 8 additions & 0 deletions app/robots/iCubErzelli02/headRetargetingParams.ini
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
remote_control_boards ("head")
# Notice the order of the joint list is not wrong.
# Indeed they are written according to the joint order of the icub-neck
joints_list ("neck_pitch", "neck_roll", "neck_yaw")

smoothingTime 1.0
PreparationSmoothingTime 3.0
PreparationJointReferenceValues (0.0 , 0.0 , 0.0)
17 changes: 17 additions & 0 deletions app/robots/iCubErzelli02/iFeelRetargetingWalking.ini
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
name iFeelRetargeting
samplingTime 0.01
robot icub
# if the following is enabled we will use smoothing with smoothingTime value (default is true)
useSmoothing 0
smoothingTime 0.25
# The max difference (threshold) of a joint value coming from the human (rad)
jointDifferenceThreshold 0.5
wholeBodyJointsPort /HumanStateWrapper/state:i
controllerJointsPort /jointPosition:o
controllerCoMPort /CoM:o

# ROBOT JOINT LIST (Notice the order of the joint list is not wrong)
# Indeed they are written according to the joint order of the walking-coordinator
joints_list ( "torso_pitch", "torso_roll", "torso_yaw",
"l_shoulder_pitch", "l_shoulder_roll", "l_shoulder_yaw", "l_elbow", "l_wrist_prosup", "l_wrist_pitch", "l_wrist_yaw",
"r_shoulder_pitch", "r_shoulder_roll", "r_shoulder_yaw", "r_elbow", "r_wrist_prosup", "r_wrist_pitch", "r_wrist_yaw")
158 changes: 158 additions & 0 deletions app/robots/iCubErzelli02/leftFingersHapticRetargetingParams.ini
Original file line number Diff line number Diff line change
@@ -0,0 +1,158 @@
###############
### ROBOT
###############
remote_control_boards ("left_arm")

remote_sensor_boards "left_hand"

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" )

joint_list ( "l_thumb_oppose", "l_thumb_proximal", "l_thumb_middle", "l_thumb_distal",
"l_index_abduction", "l_index_proximal", "l_index_middle", "l_index_distal",
"l_middle_proximal", "l_middle_middle", "l_middle_distal",
"l_ring_abduction", "l_ring_proximal", "l_ring_middle", "l_ring_distal",
"l_pinky_abduction", "l_pinky_proximal", "l_pinky_middle", "l_pinky_distal" )

# 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
analog_list ( "l_thumb_proximal", "l_thumb_middle", "l_thumb_distal",
"l_index_proximal", "l_index_middle", "l_index_distal",
"l_middle_proximal", "l_middle_middle", "l_middle_distal",
"l_ring_proximal", "l_ring_middle", "l_ring_distal",
"l_pinky_proximal", "l_pinky_middle", "l_pinky_distal" )

#Adding the groups of each axis and associated joints
l_hand_finger ( "l_index_abduction", "l_ring_abduction", "l_pinky_abduction" )
l_thumb_oppose ( "l_thumb_oppose" )
l_thumb_proximal ( "l_thumb_proximal" )
l_thumb_distal ( "l_thumb_middle", "l_thumb_distal" )
l_index_proximal ( "l_index_proximal" )
l_index_distal ( "l_index_middle", "l_index_distal" )
l_middle_proximal ( "l_middle_proximal" )
l_middle_distal ( "l_middle_middle", "l_middle_distal" )
l_pinky ( "l_ring_proximal", "l_ring_middle", "l_ring_distal", "l_pinky_proximal", "l_pinky_middle", "l_pinky_distal" )


###############
### HUMAN
###############
human_joint_list ( "l_thumb_oppose", "l_thumb_proximal", "l_thumb_middle", "l_thumb_distal",
"l_index_abduction", "l_index_proximal", "l_index_middle", "l_index_distal",
"l_middle_abduction", "l_middle_proximal", "l_middle_middle", "l_middle_distal",
"l_ring_abduction", "l_ring_proximal", "l_ring_middle", "l_ring_distal",
"l_pinky_abduction", "l_pinky_proximal", "l_pinky_middle", "l_pinky_distal" )

human_finger_list ( "l_thumb_finger", "l_index_finger", "l_middle_finger", "l_ring_finger", "l_little_finger")

hand_link l_hand

wearable_data_ports ("/WearableData/HapticGlove/LeftHand/data:o")

use_rpc 0

wearable_rpc_ports ( "/WearableData/HapticGlove/LeftHand/metadataRpc:o" )

wearable_data_actuator_ports_out "/WearableData/HapticGlove/LeftHand/Actuators/input:o"

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

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

motorsJointsCoupled 1

# 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" )
l_middle_finger ( "l_middle_proximal", "l_middle_distal" )
l_ring_finger ( "l_pinky" )
l_little_finger ( "l_pinky" )

# This gain is multiplied to the total error for each motor/axis to compute the force feedback to the user associated with each axis,
# defined according to user experience
# Number of gains = number of motors/axis
gainTotalError ( 0.0 0.0 600.0 600.0 600.0 600.0 600.0 600.0 600.0 )

# check this issue for the velocity Gain: https://github.com/dic-iit/element_retargeting-from-human/issues/141
# number of gains = number of motors/axis
gainVelocityError ( 0.0 0.0 0.1 0.1 0.1 0.1 0.1 0.1 0.1 )

# this value is multiplied to forcefeedback and provides haptic feedback to the user
gainVibrotactile ( 0.8 0.8 0.8 0.8 0.8 )

# scaling and biased values for maping the human to robot motion
# the sign of the following vector is important, while the absolute values will be found at configuration file
human_to_robot_joint_angles_scaling ( -1.0 1.0 1.0 1.0
1.0 1.0 1.0 1.0
1.0 1.0 1.0
-1.0 1.0 1.0 1.0
-1.0 1.0 1.0 1.0 )

human_to_robot_joint_anlges_bias ( 0.0 0.0 0.0 0.0
0.0 0.0 0.0 0.0
0.0 0.0 0.0
0.0 0.0 0.0 0.0
0.0 0.0 0.0 0.0 )

axisContactThreshold 0.1

##############################
### ROBOT CONTROL & ESTIMATION
##############################
useVelocity 0

referenceVelocityForPositionControl 100.0

# minimum and maximum values of the joints
# related to analog sensors
analog_joints_min_boundary ( 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 )
analog_joints_max_boundary ( 90.0 90.0 90.0 90.0 90.0 90.0 90.0 90.0 90.0 90.0 90.0 90.0 90.0 90.0 90.0 )

# hall sensors minimum and maximum values
analog_sensors_raw_min_boundary ( 249.0 221.0 255.0 255.0 240.0 253.0 248.0 245.0 244.0 255.0 247.0 255.0 245.0 248.0 247.0 )
analog_sensors_raw_max_boundary ( 2.0 29.0 7.0 0.0 4.0 0.0 8.0 54.0 0.0 36.0 0.0 0.0 0.0 15.0 0.0 )


# in case each joint does not have independant motor to actuate, they are coupled
axesJointsCoupled 1

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

#robot controller exponential filter gain
exponentialFilterGain 0.9

# q= A x m, where:
# q (n,1) is the joint values
# m (m,1) is the motors values
# A (n,m) is the mapping from the motors values to the joint values
# CouplingMatrix = A : (n,m) matrix
CouplingMatrix ( 1.1 0.0 0.0 0.0 0.0
0.0 1.0 1.0 0.0 0.0
0.0 0.0 1.0 0.0 0.0
0.0 0.0 0.0 0.0 1.0 )

# in the Quadratic optimizartion problem to compute the motor values from the joint values : xT Q X + uT R u
# q_matrix_joint_motor is a list that identifies the main diagonal values of matrix Q: (q x q) matrix;
# size of q: is the number of desired joints to control
# r_matrix_joint_motor is a list that identifies the main diagonal of matrix R: (m x m) matrix;
# size of m: is the number of desired motors to control

q_qp_control ( 1.0 1.0 1.0 1.0 1.0 1.0 1.0 1.0 1.0 1.0 1.0 1.0 1.0 1.0 1.0 1.0 1.0 1.0 1.0 )

r_qp_control ( 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 )


# in the Kalman filter problem to estimate the axis values, velocity and acceleration:
# q_matrix_kf is a list that identifies the main diagonal of matrix: E[ (w(t) -w_bar(t)) (w(t) -w_bar(t))^T ],
# size: m*m positive matrix, Dx(t)= Fx(t)+ Gw(t), the process noise */
# r_matrix_kf is a list that identifies the main diagonal of matrix: E[ v(t) v(t)^T ],
# size: p*p positive matrix, Z(t)= Hx(t)+ v(t), the measurement noise
no_states_kf 3
no_measurement_kf 1
q_matrix_kf ( 10.0 150.0 100000.0 )
r_matrix_kf ( 0.0000001 )
6 changes: 6 additions & 0 deletions app/robots/iCubErzelli02/leftFingersRetargetingParams.ini
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
remote_control_boards ("left_arm")
joints_list ("l_thumb_proximal", "l_thumb_distal", "l_index_proximal", "l_index-distal", "l_middle-proximal", "l_middle-distal", "l_little-fingers")

useVelocity 1

fingersScaling (1, 3.5, 2, 3.5, 1, 3.5, 5)
17 changes: 17 additions & 0 deletions app/robots/iCubErzelli02/leftHandRetargetingParams.ini
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
# additional rotations
# the following rotation map the hand oculus frame and the hand robot frame
handOculusFrame_R_handRobotFrame ((0.0 0.0 -1.0), (-1.0 0.0 0.0), (0.0 1.0 0.0))

# the following rotation map the teleoperation frame and the teleoperation robot
# frame the Teleoperation robot frame chosen is "imu_frame" and according to iCub
# CAD has:
# The z-axis is parallel to gravity but pointing upwards.
# The x-axis points behind the robot.
# The y-axis points laterally and is chosen according to the right-hand rule.
# the Teleoperation frame is attached to the virtualizer and the origin is the
# same oculus inertial frame. In other words:
# The z-axis is parallel to gravity but pointing upwards
# The x-axis points forward
# The y-axis points laterally and is chosen according to the right-hand rule.
# So the rotation matrix is simply given by Rotz(pi)
teleoperationRobotFrame_R_teleoperationFrame ((1.0 0.0 0.0), (0.0 1.0 0.0), (0.0 0.0 1.0))
Loading

0 comments on commit 28c685a

Please sign in to comment.