Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
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
5 changes: 5 additions & 0 deletions bibi_configuration.xsd
Original file line number Diff line number Diff line change
Expand Up @@ -244,6 +244,11 @@
<xs:documentation>The 'src' attribute denotes the path of a python file that contains the entire transfer function. If this attribute is present, the actual contents of the transfer function element is ignored and only the contents of the specified Python file are taken into account.</xs:documentation>
</xs:annotation>
</xs:attribute>
<xs:attribute name="priority" type="xs:nonNegativeInteger" use="optional">
<xs:annotation>
<xs:documentation>The 'priority' attribute is used to specify the order in which transfer functions are executed at every simulation step. Transfer functions with higher priority are executed first.</xs:documentation>
</xs:annotation>
</xs:attribute>
</xs:extension>
</xs:complexContent>
</xs:complexType>
Expand Down
1 change: 1 addition & 0 deletions iba_holodeck/brainvisualizer.json
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
{}
6 changes: 6 additions & 0 deletions iba_holodeck/iba.launch
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
<launch>
<node name="manager_module" pkg="iba_multimodule_experiment" type="manager_module.py" respawn="false" output="screen"/>
<node name="module1" pkg="iba_multimodule_experiment" type="module1.py" respawn="false" output="screen"/>
<node name="module2" pkg="iba_multimodule_experiment" type="module2.py" respawn="false" output="screen"/>
<node name="module3" pkg="iba_multimodule_experiment" type="module3.py" respawn="false" output="screen"/>
</launch>
12 changes: 12 additions & 0 deletions iba_holodeck/iba_holodeck.bibi
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
<?xml version="1.0" ?>
<ns1:bibi xmlns:ns1="http://schemas.humanbrainproject.eu/SP10/2014/BIBI" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<ns1:brainModel>
<ns1:file>brain_model/braitenberg.py</ns1:file>
<ns1:populations from="0" population="sensors" to="5" xsi:type="ns1:Range"/>
<ns1:populations from="5" population="actors" to="8" xsi:type="ns1:Range"/>
<ns1:populations from="0" population="record" to="8" xsi:type="ns1:Range"/>
</ns1:brainModel>
<ns1:bodyModel robotId="icub">icub_model/model.sdf</ns1:bodyModel>
<ns1:transferFunction src="move_target.py" xsi:type="ns1:PythonTransferFunction"/>
<ns1:transferFunction src="tf_results.py" xsi:type="ns1:PythonTransferFunction"/>
</ns1:bibi>
23 changes: 23 additions & 0 deletions iba_holodeck/iba_holodeck.exc
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
<?xml version="1.0" encoding="utf-8"?>
<ExD xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns="http://schemas.humanbrainproject.eu/SP10/2014/ExDConfig"
xsi:schemaLocation="http://schemas.humanbrainproject.eu/SP10/2014/ExDConfig ../ExDConfFile.xsd">
<name>Holodeck IBA experiment </name>
<thumbnail>iba_holodeck.jpg</thumbnail>
<description>In this experiment, we show how data can be shared and synchronization can be achieved in IBA.</description>
<tags>iba robotics holodeck</tags>
<timeout>840</timeout>
<configuration type="3d-settings" src="iba_holodeck.ini"/>
<configuration type="brainvisualizer" src="brainvisualizer.json"/>
<configuration type="user-interaction-settings" src="iba_holodeck.uis"/>
<maturity>production</maturity>
<environmentModel src="virtual_room/virtual_room_tracking_icub.sdf">
<robotPose robotId="icub" x="0.0" y="0.0" z="0.644" roll="0.0" pitch="0.0" yaw="-1.570796"/>
</environmentModel>
<bibiConf src="iba_holodeck.bibi"/>
<cameraPose>
<cameraPosition x="2.1504202465717563" y="1.2381462778435453" z="1.3380507195673994"/>
<cameraLookAt x="0.0" y="1.48" z="0.6"/>
</cameraPose>
<rosLaunch src="iba.launch"/>
</ExD>
92 changes: 92 additions & 0 deletions iba_holodeck/iba_holodeck.ini
Original file line number Diff line number Diff line change
@@ -0,0 +1,92 @@
{
"dynamicEnvMap": true,
"shadows": true,
"antiAliasing": true,
"ssao": false,
"ssaoDisplay": false,
"ssaoClamp": "0.94",
"ssaoLumInfluence": "1",
"rgbCurve": {
"red": [
[
0,
0
],
[
0.410400390625,
0.4481201171875
],
[
0.761962890625,
0.7957763671875
],
[
1,
1
]
],
"green": [
[
0,
0
],
[
0.261962890625,
0.2801513671875
],
[
0.718994140625,
0.7371826171875
],
[
1,
1
]
],
"blue": [
[
0,
0
],
[
0.265869140625,
0.2606201171875
],
[
0.840087890625,
0.7645263671875
],
[
1,
1
]
]
},
"levelsInBlack": "0.09",
"levelsInGamma": 0.52,
"levelsInWhite": "0.8",
"levelsOutBlack": 0,
"levelsOutWhite": 1,
"skyBox": "forest",
"sun": "",
"bloom": false,
"bloomStrength": "0.83",
"bloomRadius": "0.29",
"bloomThreshold": "0.91",
"fog": true,
"fogDensity": "0.02",
"fogColor": "#97a2af",
"pbrMaterial": true,
"shadowSettings": [
{
"lightName": "sun",
"mapSize": 4096,
"cameraBottom": -10,
"cameraLeft": -10,
"cameraRight": 10,
"cameraTop": 25,
"bias": 0.0003,
"radius": 1.2
}
]
}
Binary file added iba_holodeck/iba_holodeck.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
9 changes: 9 additions & 0 deletions iba_holodeck/iba_holodeck.uis
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
{
"camera": {
"defaultMode": "free-camera",
"sensitivity": {
"translation": 1.0,
"rotation": 1.0
}
}
}
37 changes: 37 additions & 0 deletions iba_holodeck/move_target.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
# Imported Python Transfer Function
#
from gazebo_msgs.srv import SetModelState
import rospy
rospy.wait_for_service("/gazebo/set_model_state")
service_proxy = rospy.ServiceProxy('/gazebo/set_model_state', SetModelState, persistent=True)
@nrp.MapVariable("target_freq", initial_value=0.3)
@nrp.MapVariable("target_ampl", initial_value=0.3)
@nrp.MapVariable("target_center", initial_value={'x': 0, 'y': 2.42, 'z': 1.2})
@nrp.MapVariable("set_model_state_srv", initial_value=service_proxy)
@nrp.Robot2Neuron() # dummy R2N
def move_target(t, target_freq, target_ampl, target_center, set_model_state_srv):
ms_msg = gazebo_msgs.msg.ModelState()
frequency = target_freq.value
amplitude = target_ampl.value
center = target_center.value
ms_msg.model_name = 'Target'
# set orientation RYP axes
ms_msg.pose.orientation.x = 0
ms_msg.pose.orientation.y = 1
ms_msg.pose.orientation.z = 1
# reference frame
ms_msg.reference_frame = 'world'
#pose
ms_msg.pose.position.x = \
center['x'] + np.sin(t * frequency * 2 * np.pi) * (float(amplitude) / 2)
ms_msg.pose.position.y = center['y']
ms_msg.pose.position.z = center['z']
#scale
ms_msg.scale.x = ms_msg.scale.y = ms_msg.scale.z = 1.0
#call service
response = set_model_state_srv.value(ms_msg)
#check response
if not response.success:
clientLogger.info(response.status_message)
#

Binary file added iba_holodeck/resources/textures/1146.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added iba_holodeck/resources/textures/307.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added iba_holodeck/resources/textures/3150.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added iba_holodeck/resources/textures/4442.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
23 changes: 23 additions & 0 deletions iba_holodeck/tf_results.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
# Imported Python Transfer Function
#
from std_msgs.msg import Float64
@nrp.MapVariable("eye_position", scope=nrp.GLOBAL)
@nrp.MapSpikeSink("result_0_dv", nrp.brain.actors[1], nrp.leaky_integrator_alpha)
@nrp.MapSpikeSink("result_1_dv", nrp.brain.actors[2], nrp.leaky_integrator_alpha)
@nrp.Neuron2Robot(Topic('/icub/eye_version/pos', Float64))
def tf_results(t, eye_position, result_0_dv, result_1_dv):
def deg2rad(deg):
"""
Degrees to radians conversion function.
:param deg: value in degrees
:return: value of deg in radians
"""
return (float(deg) / 360.) * (2. * np.pi)
if eye_position.value is None:
return 0.0
d = result_1_dv.voltage - result_0_dv.voltage
max_mov = 1.0
ret = eye_position.value + deg2rad(-((d + 0.03) / 0.09 * 2 * max_mov - max_mov))
return ret
#

2 changes: 1 addition & 1 deletion template_requirements.txt
Original file line number Diff line number Diff line change
@@ -1 +1 @@
pillow==5.0.0
pillow==6.2.0