diff --git a/bibi_configuration.xsd b/bibi_configuration.xsd index bcb4850..b5c49ed 100644 --- a/bibi_configuration.xsd +++ b/bibi_configuration.xsd @@ -244,6 +244,11 @@ 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. + + + 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. + + diff --git a/iba_holodeck/brainvisualizer.json b/iba_holodeck/brainvisualizer.json new file mode 100644 index 0000000..9e26dfe --- /dev/null +++ b/iba_holodeck/brainvisualizer.json @@ -0,0 +1 @@ +{} \ No newline at end of file diff --git a/iba_holodeck/iba.launch b/iba_holodeck/iba.launch new file mode 100644 index 0000000..f36b4ce --- /dev/null +++ b/iba_holodeck/iba.launch @@ -0,0 +1,6 @@ + + + + + + diff --git a/iba_holodeck/iba_holodeck.bibi b/iba_holodeck/iba_holodeck.bibi new file mode 100644 index 0000000..f444e30 --- /dev/null +++ b/iba_holodeck/iba_holodeck.bibi @@ -0,0 +1,12 @@ + + + + brain_model/braitenberg.py + + + + + icub_model/model.sdf + + + diff --git a/iba_holodeck/iba_holodeck.exc b/iba_holodeck/iba_holodeck.exc new file mode 100644 index 0000000..be36a97 --- /dev/null +++ b/iba_holodeck/iba_holodeck.exc @@ -0,0 +1,23 @@ + + + Holodeck IBA experiment + iba_holodeck.jpg + In this experiment, we show how data can be shared and synchronization can be achieved in IBA. + iba robotics holodeck + 840 + + + + production + + + + + + + + + + diff --git a/iba_holodeck/iba_holodeck.ini b/iba_holodeck/iba_holodeck.ini new file mode 100644 index 0000000..ea6d64c --- /dev/null +++ b/iba_holodeck/iba_holodeck.ini @@ -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 + } + ] +} \ No newline at end of file diff --git a/iba_holodeck/iba_holodeck.jpg b/iba_holodeck/iba_holodeck.jpg new file mode 100644 index 0000000..deffd86 Binary files /dev/null and b/iba_holodeck/iba_holodeck.jpg differ diff --git a/iba_holodeck/iba_holodeck.uis b/iba_holodeck/iba_holodeck.uis new file mode 100644 index 0000000..cca085f --- /dev/null +++ b/iba_holodeck/iba_holodeck.uis @@ -0,0 +1,9 @@ +{ + "camera": { + "defaultMode": "free-camera", + "sensitivity": { + "translation": 1.0, + "rotation": 1.0 + } + } +} diff --git a/iba_holodeck/move_target.py b/iba_holodeck/move_target.py new file mode 100644 index 0000000..1e103b0 --- /dev/null +++ b/iba_holodeck/move_target.py @@ -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) +# + diff --git a/iba_holodeck/resources/textures/1146.png b/iba_holodeck/resources/textures/1146.png new file mode 100644 index 0000000..6825405 Binary files /dev/null and b/iba_holodeck/resources/textures/1146.png differ diff --git a/iba_holodeck/resources/textures/307.png b/iba_holodeck/resources/textures/307.png new file mode 100644 index 0000000..b7867f1 Binary files /dev/null and b/iba_holodeck/resources/textures/307.png differ diff --git a/iba_holodeck/resources/textures/3150.png b/iba_holodeck/resources/textures/3150.png new file mode 100644 index 0000000..9759485 Binary files /dev/null and b/iba_holodeck/resources/textures/3150.png differ diff --git a/iba_holodeck/resources/textures/4442.png b/iba_holodeck/resources/textures/4442.png new file mode 100644 index 0000000..536e676 Binary files /dev/null and b/iba_holodeck/resources/textures/4442.png differ diff --git a/iba_holodeck/tf_results.py b/iba_holodeck/tf_results.py new file mode 100644 index 0000000..135dcb1 --- /dev/null +++ b/iba_holodeck/tf_results.py @@ -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 +# + diff --git a/template_requirements.txt b/template_requirements.txt index d0a3e3e..3d03442 100644 --- a/template_requirements.txt +++ b/template_requirements.txt @@ -1 +1 @@ -pillow==5.0.0 \ No newline at end of file +pillow==6.2.0 \ No newline at end of file