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

Implementation of ICub device #25

Merged
merged 36 commits into from
Aug 13, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
36 commits
Select commit Hold shift + click to select a range
7d59c3f
Icub device initial commit
yeshasvitirupachuri Oct 4, 2018
279d545
Implement sensor methods
yeshasvitirupachuri Oct 4, 2018
1cc0ad7
Implement getTimeStamp method
yeshasvitirupachuri Oct 4, 2018
1db357d
Update CMakeLists.txt
yeshasvitirupachuri Oct 4, 2018
e74df3e
Update timestamp implementation
yeshasvitirupachuri Oct 5, 2018
79a254f
Update CMakeLists and add config file
yeshasvitirupachuri Oct 5, 2018
263e9ab
Implement getLastInputStamp method
yeshasvitirupachuri Oct 5, 2018
fc1d0ac
Implement getStatus method
yeshasvitirupachuri Oct 5, 2018
5358ada
Fix sensor type
yeshasvitirupachuri Oct 5, 2018
4489de8
Update wrapper details in config
yeshasvitirupachuri Oct 5, 2018
f6d6608
Update status handling
yeshasvitirupachuri Oct 5, 2018
f2cfe7f
Implement bufferport callback
yeshasvitirupachuri Oct 8, 2018
90c4fd7
Improve status update logic
yeshasvitirupachuri Oct 9, 2018
74d4613
Remode debug code
yeshasvitirupachuri Oct 9, 2018
d85c934
Update wrench handling
yeshasvitirupachuri Oct 10, 2018
11e8e6c
Add mutex to wrench handling
yeshasvitirupachuri Oct 16, 2018
a668541
Add ICub config file
yeshasvitirupachuri Dec 4, 2018
e572a86
Update PR changes
yeshasvitirupachuri Jan 3, 2019
a5a1828
Cleanup open configuration
yeshasvitirupachuri Jan 4, 2019
08af84f
Update port connection
yeshasvitirupachuri Jan 4, 2019
8b26b9f
Update separator usage
yeshasvitirupachuri Jan 4, 2019
5edbcba
remove Yarp Init check in ICub
lrapetti Jan 15, 2019
ac1e9ef
Update PR changes
yeshasvitirupachuri Jan 21, 2019
f60753e
Beautify using wearables clang format file
yeshasvitirupachuri Jan 21, 2019
9ef08c3
Update PR changes
yeshasvitirupachuri Feb 11, 2019
66b8fba
Add yarp network member to ICub
lrapetti Feb 20, 2019
660d4a7
update config file names and add yarpmanager files
yeshasvitirupachuri Feb 3, 2019
199d179
Add and Implement VirtualJointKinSensor
yeshasvitirupachuri Apr 3, 2019
cf6aaf9
Update devices with VirtualJointKinSensor
yeshasvitirupachuri Apr 3, 2019
d5707a4
Implement VirtualJointLinkSensor in ICub device
yeshasvitirupachuri Apr 4, 2019
e5fd5df
Update wrench handling through configuration file
yeshasvitirupachuri Apr 23, 2019
c0b229e
Implement virtual link sensors - link pose interface
yeshasvitirupachuri Apr 23, 2019
dbb7b7e
Add link velocity computation
yeshasvitirupachuri May 22, 2019
01d9fe6
remove output port for virtualJointKinSensors
lrapetti Jul 3, 2019
32747cb
fix ICub device CMake
lrapetti Jul 4, 2019
42eba1b
minor fixies on ICub device
lrapetti Jul 4, 2019
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
32 changes: 32 additions & 0 deletions app/Wearables-yarpmanager.ini
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
# Path to the folder which contains application description files
apppath = "xml/applications"
load_subfolders = yes

# Path to the folder which contains module description files
#modpath = "xml/modules"

# Path to the folder which contains module description files
#respath = "xml/resources"

# Fault tolerance
# parameters: yes|No
watchdog = no

# Module failure awareness (if watchdog is enabled)
# parameters: Ignore|terminate|prompt|recover
module_failure = prompt

# Connection failure awareness (if watchdog is enabled)
# parameters: Ignore|terminate|prompt
connection_failure = prompt

# Automatically establish all connections
# parameters: Yes|no
auto_connect = no

# Appearance (for yarpmanager)
# parameters: No|dark|light
color_theme = dark

# External editor (e.g. gedit, notepad)
external_editor = gvim
30 changes: 30 additions & 0 deletions app/xml/ICubWearableDevice.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
<?xml version="1.0" encoding="UTF-8" ?>
<robot name="ICub">
<device type="icub_wearable_device" name="ICubWearableDevice">
<param name="urdf">model.urdf</param>
<param name="floatingBase">root_link</param>
<group name="ft-sensors">
<param name="leftHandWBDFTSensor">/wholeBodyDynamics/left_arm/endEffectorWrench:o</param>
<param name="rightHandWBDFTSensor">/wholeBodyDynamics/right_arm/endEffectorWrench:o</param>
<param name="LeftFootWBDFTSensor">/wholeBodyDynamics/left_foot/cartesianEndEffectorWrench:o</param>
<param name="rightFootWBDFTSensor">/wholeBodyDynamics/right_foot/cartesianEndEffectorWrench:o</param>
</group>
<group name="joint-sensors">
<param name="controlBoardsList">(head torso left_arm right_arm left_leg right_leg)</param>
<param name="remotePrefix">/icubSim</param>
<param name="localPrefix">/ICubWearableRemoteClient</param>
</group>
</device>

<device type="iwear_wrapper" name="ICubWearableDeviceWrapper">
<param name="period">0.01</param>
<param name="dataPortName">/ICub/WearableData/data:o</param>
<param name="rpcPortName">/ICub/WearableData/metadataRpc:o</param>
<action phase="startup" level="5" type="attach">
<paramlist name="networks">
<elem name="ICubWearableDeviceWrapper"> ICubWearableDevice </elem>
</paramlist>
</action>
<action phase="shutdown" level="5" type="detach"/>
</device>
</robot>
File renamed without changes.
50 changes: 50 additions & 0 deletions app/xml/applications/WearableDevices.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
<application>
<name>WearableDevices</name>
<description>An application for running wearable devices</description>

<!--yarprobotinterface for xsens suit wearable device-->
<module>
<name>yarprobotinterface</name>
<parameters>--config XsensSuitWearableDevice.xml</parameters>
<environment>YARP_FORWARD_LOG_ENABLE=1</environment>
<description>Run xsens suit wearable device</description>
<node>localhost</node>
</module>

<!--yarprobotinterface for left ftshoe wearable device-->
<module>
<name>yarprobotinterface</name>
<parameters>--config FTShoeLeftWearableDevice.xml</parameters>
<environment>YARP_FORWARD_LOG_ENABLE=1</environment>
<description>Run left ftshoe wearable device</description>
<node>localhost</node>
</module>

<!--yarprobotinterface for right ftshoe wearable device-->
<module>
<name>yarprobotinterface</name>
<parameters>--config FTShoeRightWearableDevice.xml</parameters>
<environment>YARP_FORWARD_LOG_ENABLE=1</environment>
<description>Run right ftshoe wearable device</description>
<node>localhost</node>
</module>

<!--yarprobotinterface for skin insoles wearable device-->
<module>
<name>yarprobotinterface</name>
<parameters>--config SkinInsolesWearableDevice.xml</parameters>
<environment>YARP_FORWARD_LOG_ENABLE=1</environment>
<description>Run skin insoles wearable device</description>
<node>localhost</node>
</module>

<!--yarprobotinterface for icub wearable device-->
<module>
<name>yarprobotinterface</name>
<parameters>--config ICubWearableDevice.xml</parameters>
<environment>YARP_FORWARD_LOG_ENABLE=1</environment>
<description>Run icub wearable device</description>
<node>localhost</node>
</module>

</application>
7 changes: 7 additions & 0 deletions devices/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,16 @@
# This software may be modified and distributed under the terms of the
# GNU Lesser General Public License v2.1 or any later version.

find_package(iDynTree)

add_subdirectory(IWearRemapper)
add_subdirectory(IAnalogSensorToIWear)

if(XSENS_MVN_USE_SDK)
add_subdirectory(XsensSuit)
endif()

if(iDynTree_FOUND)
add_subdirectory(ICub)
endif()

3 changes: 3 additions & 0 deletions devices/IAnalogSensorToIWear/include/IAnalogSensorToIWear.h
Original file line number Diff line number Diff line change
Expand Up @@ -121,6 +121,9 @@ class wearable::devices::IAnalogSensorToIWear
SensorPtr<const sensor::IVirtualLinkKinSensor>
getVirtualLinkKinSensor(const sensor::SensorName name) const override;

SensorPtr<const sensor::IVirtualJointKinSensor>
getVirtualJointKinSensor(const sensor::SensorName name) const override;

SensorPtr<const sensor::IVirtualSphericalJointKinSensor>
getVirtualSphericalJointKinSensor(const sensor::SensorName name) const override;
};
Expand Down
9 changes: 9 additions & 0 deletions devices/IAnalogSensorToIWear/src/IAnalogSensorToIWear.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -298,6 +298,8 @@ wearable::sensor::SensorType sensorTypeFromString(std::string sensorTypeString)
return wearable::sensor::SensorType::Torque3DSensor;
else if (sensorTypeString == "VirtualLinkKinSensor")
return wearable::sensor::SensorType::VirtualLinkKinSensor;
else if (sensorTypeString == "VirtualJointKinSensor")
return wearable::sensor::SensorType::VirtualJointKinSensor;
else if (sensorTypeString == "VirtualSphericalJointKinSensor")
return wearable::sensor::SensorType::VirtualSphericalJointKinSensor;
else {
Expand Down Expand Up @@ -707,6 +709,13 @@ IAnalogSensorToIWear::getVirtualLinkKinSensor(const wearable::sensor::SensorName
return nullptr;
}

wearable::SensorPtr<const wearable::sensor::IVirtualJointKinSensor>
IAnalogSensorToIWear::getVirtualJointKinSensor(
const wearable::sensor::SensorName /*name*/) const
{
return nullptr;
}

wearable::SensorPtr<const wearable::sensor::IVirtualSphericalJointKinSensor>
IAnalogSensorToIWear::getVirtualSphericalJointKinSensor(
const wearable::sensor::SensorName /*name*/) const
Expand Down
37 changes: 37 additions & 0 deletions devices/ICub/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
# Copyright (C) 2018 Istituto Italiano di Tecnologia (IIT). All rights reserved.
# This software may be modified and distributed under the terms of the
# GNU Lesser General Public License v2.1 or any later version.

yarp_prepare_plugin(icub_wearable_device
TYPE wearable::devices::ICub
INCLUDE ICub.h
CATEGORY device
ADVANCED
DEFAULT ON)

yarp_add_plugin(ICub
src/ICub.cpp
include/ICub.h)

target_include_directories(ICub PRIVATE
$<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}/include>)

target_link_libraries(ICub
PUBLIC
Wearable::IWear
YARP::YARP_dev
YARP::YARP_init
PRIVATE
iDynTree::idyntree-model
iDynTree::idyntree-high-level)

yarp_install(
TARGETS ICub
COMPONENT runtime
LIBRARY DESTINATION ${YARP_DYNAMIC_PLUGINS_INSTALL_DIR}
ARCHIVE DESTINATION ${YARP_STATIC_PLUGINS_INSTALL_DIR})

yarp_install(
FILES "${CMAKE_CURRENT_SOURCE_DIR}/icub_wearable_device.ini"
DESTINATION ${YARP_PLUGIN_MANIFESTS_INSTALL_DIR})

30 changes: 30 additions & 0 deletions devices/ICub/conf/ICub.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
<?xml version="1.0" encoding="UTF-8" ?>
<robot name="ICub">
<device type="icub_wearable_device" name="ICubWearableDevice">
<param name="urdf">model.urdf</param>
<param name="floatingBase">root_link</param>
<group name="ft-sensors">
<param name="leftHandWBDFTSensor">/wholeBodyDynamics/left_arm/endEffectorWrench:o</param>
<param name="rightHandWBDFTSensor">/wholeBodyDynamics/right_arm/endEffectorWrench:o</param>
<param name="LeftFootWBDFTSensor">/wholeBodyDynamics/left_foot/cartesianEndEffectorWrench:o</param>
<param name="rightFootWBDFTSensor">/wholeBodyDynamics/right_foot/cartesianEndEffectorWrench:o</param>
</group>
<group name="joint-sensors">
<param name="controlBoardsList">(head torso left_arm right_arm left_leg right_leg)</param>
<param name="remotePrefix">/icubSim</param>
<param name="localPrefix">/ICubWearableRemoteClient</param>
</group>
</device>

<device type="iwear_wrapper" name="ICubWearableDeviceWrapper">
<param name="period">0.01</param>
<param name="dataPortName">/ICub/WearableData/data:o</param>
<param name="rpcPortName">/ICub/WearableData/metadataRpc:o</param>
<action phase="startup" level="5" type="attach">
<paramlist name="networks">
<elem name="ICubWearableDeviceWrapper"> ICubWearableDevice </elem>
</paramlist>
</action>
<action phase="shutdown" level="5" type="detach"/>
</device>
</robot>
5 changes: 5 additions & 0 deletions devices/ICub/icub_wearable_device.ini
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
[plugin icub_wearable_device]
type device
name icub_wearable_device
library ICub
wrapper iwear_wrapper
Loading