{"action":"opened","issue":{"url":"https://api.github.com/repos/morse-simulator/morse/issues/638","labels_url":"https://api.github.com/repos/morse-simulator/morse/issues/638/labels{/name}","comments_url":"https://api.github.com/repos/morse-simulator/morse/issues/638/comments","events_url":"https://api.github.com/repos/morse-simulator/morse/issues/638/events","html_url":"https://github.com/morse-simulator/morse/issues/638","id":93663765,"number":638,"title":"AttributeError: 'AlwaysSensor' object has no attribute 'frequency'","user":{"login":"pringlized","id":1266184,"avatar_url":"https://avatars.githubusercontent.com/u/1266184?v=3","gravatar_id":"","url":"https://api.github.com/users/pringlized","html_url":"https://github.com/pringlized","followers_url":"https://api.github.com/users/pringlized/followers","following_url":"https://api.github.com/users/pringlized/following{/other_user}","gists_url":"https://api.github.com/users/pringlized/gists{/gist_id}","starred_url":"https://api.github.com/users/pringlized/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/pringlized/subscriptions","organizations_url":"https://api.github.com/users/pringlized/orgs","repos_url":"https://api.github.com/users/pringlized/repos","events_url":"https://api.github.com/users/pringlized/events{/privacy}","received_events_url":"https://api.github.com/users/pringlized/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":0,"created_at":"2015-07-08T00:52:04Z","updated_at":"2015-07-08T00:52:04Z","closed_at":null,"body":"I'm new to Morse.  Installed it recently using the [Homebrew instructions](http://www.openrobots.org/morse/doc/1.3/user/installation/package_manager/homebrew_osx.html) on my MacBookPro running Yosemite 10.10.3.  Running the initial sockets tutorial and also connecting to it from a socket client works fine. I added a few things like a light, and had it just drive in a circle.  No problem.  But when I start adding a variety of sensors it errors out with: AttributeError: 'AlwaysSensor' object has no attribute 'frequency'\r\n\r\nI tested a variety of sensors and most fail on creating the object: SemanticCamera, VideoCamera, SickLRDS, Proximity, etc..  But some do work like: Pose, Collision, etc..\r\n\r\nBeen digging through source code even though not very familiar with Blender's source or Morse.  Haven't been able to nail down the culprit yet.  Any help would be much appreciated.\r\n\r\nGreat project!  Appreciate all the work that has been done on it. Thanks.\r\n\r\n##### Running tutorial code with a Proximity sensor\r\n```\r\n$ morse run tutorial-1-sockets.py \r\n* Loading simulation </Users/jim/Dev/morse-sim/tutorials/tutorial-1-sockets.py>.\r\n\r\n* morse 1.3-dirty\r\n\r\n* MORSE has only been tested on Linux. It may work\r\non other operating systems as well, but without any guarantee\r\n\r\n* Version 2.75.0 of Blender is untested but should work\r\n\r\nndof: 3Dx driver not found\r\nfound bundled python: /Applications/Blender_2.75/blender.app/Contents/MacOS/../Resources/2.75/python\r\nread blend: /usr/local/share/morse/data/morse_default_autorun.blend\r\n[ERROR][MORSE] Uncaught exception, quit Blender.\r\nTraceback (most recent call last):\r\n  File \"/Users/user/Dev/morse-sim/tutorials/tutorial-1-sockets.py\", line 17, in <module>\r\n    proximity = Proximity()\r\n  File \"/usr/local/Cellar/morse-simulator/1.3/lib/python3.4/site-packages/morse/builder/sensors.py\", line 111, in __init__\r\n    self.frequency(12)\r\n  File \"/usr/local/Cellar/morse-simulator/1.3/lib/python3.4/site-packages/morse/builder/abstractcomponent.py\", line 523, in frequency\r\n    morselogic[0].frequency = delay\r\nAttributeError: 'AlwaysSensor' object has no attribute 'frequency'\r\nTraceback (most recent call last):\r\n  File \"/Users/user/Dev/morse-sim/tutorials/tutorial-1-sockets.py\", line 17, in <module>\r\n    proximity = Proximity()\r\n  File \"/usr/local/Cellar/morse-simulator/1.3/lib/python3.4/site-packages/morse/builder/sensors.py\", line 111, in __init__\r\n    self.frequency(12)\r\n  File \"/usr/local/Cellar/morse-simulator/1.3/lib/python3.4/site-packages/morse/builder/abstractcomponent.py\", line 523, in frequency\r\n    morselogic[0].frequency = delay\r\nAttributeError: 'AlwaysSensor' object has no attribute 'frequency'\r\n```\r\n\r\n##### Running tutorial WITHOUT Proximity sensor\r\n```\r\n$ morse run tutorial-1-sockets.py \r\n* Loading simulation </Users/user/Dev/morse-sim/tutorials/tutorial-1-sockets.py>.\r\n\r\n* morse 1.3-dirty\r\n\r\n* MORSE has only been tested on Linux. It may work\r\non other operating systems as well, but without any guarantee\r\n\r\n* Version 2.75.0 of Blender is untested but should work\r\n\r\nndof: 3Dx driver not found\r\nfound bundled python: /Applications/Blender_2.75/blender.app/Contents/MacOS/../Resources/2.75/python\r\nread blend: /usr/local/share/morse/data/morse_default_autorun.blend\r\nmorse.sensors.collision.Collision: no interfaces available for this component! Trying to use default one for socket.\r\nDetected GL_ARB_texture_env_combine\r\nDetected GL_ARB_texture_cube_map\r\nDetected GL_ARB_multitexture\r\nDetected GL_ARB_shader_objects\r\nDetected GL_ARB_vertex_shader\r\nDetected GL_ARB_fragment_shader\r\nDetected GL_ARB_vertex_program\r\nDetected GL_ARB_depth_texture\r\nDetected GL_EXT_separate_specular_color\r\n\r\nBlender Game Engine Started\r\n==============================\r\nWelcome to the MORSE simulator\r\n==============================\r\n\r\n[PRE-INITIALIZATION]\r\n[    0.014] Python Version: 3.4.2\r\n[    0.014] Blender Version: 2.75.0\r\n[    0.014] Python path: ['/usr/local/share/morse/data', '/usr/local/share/morse/data/props', '/usr/local/share/morse/data/environments/indoors-1', '/usr/local/share/morse/data/actuators', '/usr/local/share/morse/data/robots', '/Applications/Blender_2.75/blender.app/Contents/Resources/2.75/scripts/addons', '/Applications/Blender_2.75/blender.app/Contents/Resources/2.75/scripts/modules', '/Applications/Blender_2.75/blender.app/Contents/Resources/2.75/scripts/startup', '/Applications/Blender_2.75/blender.app/Contents/MacOS/../Resources/2.75/scripts/modules', '/usr/local/Cellar/morse-simulator/1.3/bin', '/Library/Frameworks/Python.framework/Versions/3.4/bin/python3', '/Library/Frameworks/Python.framework/Versions/3.4/lib/python34.zip', '/Library/Frameworks/Python.framework/Versions/3.4/lib/python3.4', '/Library/Frameworks/Python.framework/Versions/3.4/lib/python3.4/plat-darwin', '/Library/Frameworks/Python.framework/Versions/3.4/lib/python3.4/lib-dynload', '/Library/Frameworks/Python.framework/Versions/3.4/lib/python3.4/site-packages', '/usr/local/Cellar/morse-simulator/1.3/lib/python3.4/site-packages', '/Applications/Blender_2.75/blender.app/Contents/Resources/2.75/python/lib/python34.zip', '/Applications/Blender_2.75/blender.app/Contents/Resources/2.75/python/lib/python3.4', '/Applications/Blender_2.75/blender.app/Contents/Resources/2.75/python/lib/python3.4/plat-darwin', '/Applications/Blender_2.75/blender.app/Contents/Resources/2.75/python/lib/python3.4/lib-dynload', '/Applications/Blender_2.75/blender.app/Contents/Resources/2.75/python/lib/python3.4/site-packages', '/Applications/Blender_2.75/blender.app/Contents/MacOS/../Resources/2.75/scripts/freestyle/modules', '/Applications/Blender_2.75/blender.app/Contents/Resources/2.75/scripts/addons/modules', '/Users/jim/Library/Application Support/Blender/2.75/scripts/addons/modules', '/usr/local/Cellar/morse-simulator/1.3/lib/python3.4/site-packages/morse/blender', '/usr/local/Cellar/morse-simulator/1.3/lib/python3.4/site-packages/morse/blender/human_interaction']\r\n[    0.014] PID: 25179\r\n[    0.014] [core.morse_time] Morse configured in Best Effort Mode\r\n[    0.015] Added RedBox as a active object\r\n[    0.015] Added GreenBox as a active object\r\n[    0.015] Added BlueBox as a active object\r\n[    0.075] [robots.atrv] atrv initialization\r\nMethod SCA_ISensor.frequency is deprecated, please use SCA_ISensor.skippedTicks instead.\r\n/usr/local/Cellar/morse-simulator/1.3/lib/python3.4/site-packages/morse/core/object.py:56\r\n[    0.075] [robots.atrv] Component initialized\r\n[    0.112] [actuators.v_omega] atrv.motion initialization\r\n[    0.112] [actuators.v_omega] Component initialized\r\n[    0.112] Component atrv.motion  added to atrv\r\n[    0.189] [sensors.pose] atrv.pose initialization\r\n[    0.190] [sensors.pose] Component initialized, runs at 60.00 Hz\r\n[    0.191] Component atrv.pose  added to atrv\r\n[    0.274] [actuators.light] atrv.light initialization\r\n[    0.275] [actuators.light] Component initialized\r\n[    0.276] Component atrv.light  added to atrv\r\n[    0.277] [sensors.collision] atrv.collision initialization\r\n[    0.278] [core.object] Can't get frequency for atrv.collision as the Game Logic sensor calling the action can't be found.\r\n[    0.278] [sensors.collision] Component initialized, runs at 60.00 Hz\r\n[    0.279] Component atrv.collision  added to atrv\r\n[    0.319] [sensors.battery] atrv.battery initialization\r\n[    0.320] [sensors.battery] Component initialized, runs at 60.00 Hz\r\n[    0.320] Component atrv.battery  added to atrv\r\n[    0.369] [actuators.gripper] atrv.gripper initialization\r\n[    0.370] [actuators.gripper] Component initialized\r\n[    0.370] Component atrv.gripper  added to atrv\r\n\r\n[SUPERVISION SERVICES INITIALIZATION]\r\n[    0.377] No multi-node scene configuration file found. Multi-node support disabled.\r\n[    0.452] [middleware.socket_request_manager] Socket service manager now listening on port 4000.\r\n[    0.452] [core.services] Successfully initialized the morse.middleware.socket_request_manager.SocketRequestManager request manager.\r\n[    0.452] Adding 'morse.middleware.socket_request_manager.SocketRequestManager' to the middlewares for simulation control\r\n[    0.453] [core.request_manager] Socket service manager: Synchronous service 'activate' for component 'simulation' successfully registered\r\n[    0.453] [core.request_manager] Socket service manager: Synchronous service 'deactivate' for component 'simulation' successfully registered\r\n[    0.453] [core.request_manager] Socket service manager: Synchronous service 'details' for component 'simulation' successfully registered\r\n[    0.453] [core.request_manager] Socket service manager: Synchronous service 'get_camarafp_projection_matrix' for component 'simulation' successfully registered\r\n[    0.453] [core.request_manager] Socket service manager: Synchronous service 'get_scene_objects' for component 'simulation' successfully registered\r\n[    0.454] [core.request_manager] Socket service manager: Synchronous service 'list_robots' for component 'simulation' successfully registered\r\n[    0.454] [core.request_manager] Socket service manager: Synchronous service 'quit' for component 'simulation' successfully registered\r\n[    0.454] [core.request_manager] Socket service manager: Synchronous service 'reset_objects' for component 'simulation' successfully registered\r\n[    0.454] [core.request_manager] Socket service manager: Synchronous service 'restore_dynamics' for component 'simulation' successfully registered\r\n[    0.454] [core.request_manager] Socket service manager: Synchronous service 'set_camarafp_far_clip' for component 'simulation' successfully registered\r\n[    0.454] [core.request_manager] Socket service manager: Synchronous service 'set_camarafp_position' for component 'simulation' successfully registered\r\n[    0.454] [core.request_manager] Socket service manager: Synchronous service 'set_camarafp_projection_matrix' for component 'simulation' successfully registered\r\n[    0.455] [core.request_manager] Socket service manager: Synchronous service 'set_camarafp_transform' for component 'simulation' successfully registered\r\n[    0.455] [core.request_manager] Socket service manager: Synchronous service 'set_log_level' for component 'simulation' successfully registered\r\n[    0.455] [core.request_manager] Socket service manager: Synchronous service 'set_object_dynamics' for component 'simulation' successfully registered\r\n[    0.455] [core.request_manager] Socket service manager: Synchronous service 'set_object_visibility' for component 'simulation' successfully registered\r\n[    0.455] [core.request_manager] Socket service manager: Synchronous service 'suspend_dynamics' for component 'simulation' successfully registered\r\n[    0.455] [core.request_manager] Socket service manager: Synchronous service 'terminate' for component 'simulation' successfully registered\r\n[    0.455] Adding 'morse.middleware.socket_request_manager.SocketRequestManager' to the middlewares for time control\r\n[    0.456] [core.request_manager] Socket service manager: Synchronous service 'mode' for component 'time' successfully registered\r\n[    0.456] [core.request_manager] Socket service manager: Synchronous service 'now' for component 'time' successfully registered\r\n[    0.456] [core.request_manager] Socket service manager: Asynchronous service 'sleep' for component 'time' successfully registered\r\n[    0.456] [core.request_manager] Socket service manager: Synchronous service 'statistics' for component 'time' successfully registered\r\n[    0.456] Adding 'morse.middleware.socket_request_manager.SocketRequestManager' to the middlewares for communication control\r\n[    0.457] [core.request_manager] Socket service manager: Synchronous service 'distance_and_view' for component 'communication' successfully registered\r\n[SUPERVISION SERVICES INITIALIZED]\r\n\r\n[SCENE INITIALIZATION]\r\n[    0.458] [core.request_manager] Socket service manager: Synchronous service 'get_configurations' for component 'atrv.collision' successfully registered\r\n[    0.458] [core.request_manager] Socket service manager: Synchronous service 'get_local_data' for component 'atrv.collision' successfully registered\r\n[    0.458] [core.request_manager] Socket service manager: Synchronous service 'get_properties' for component 'atrv.collision' successfully registered\r\n[    0.460] [core.request_manager] Socket service manager: Synchronous service 'set_property' for component 'atrv.collision' successfully registered\r\n[    0.461] Component: 'atrv.collision' using middleware 'morse.middleware.socket_request_manager.SocketRequestManager' for services\r\n[    0.461] [core.request_manager] Socket service manager: Synchronous service 'get_configurations' for component 'atrv.light' successfully registered\r\n[    0.461] [core.request_manager] Socket service manager: Synchronous service 'get_properties' for component 'atrv.light' successfully registered\r\n[    0.461] [core.request_manager] Socket service manager: Synchronous service 'set_property' for component 'atrv.light' successfully registered\r\n[    0.462] [core.request_manager] Socket service manager: Synchronous service 'toggle' for component 'atrv.light' successfully registered\r\n[    0.462] Component: 'atrv.light' using middleware 'morse.middleware.socket_request_manager.SocketRequestManager' for services\r\n[    0.462] [core.request_manager] Socket service manager: Synchronous service 'get_configurations' for component 'atrv.pose' successfully registered\r\n[    0.462] [core.request_manager] Socket service manager: Synchronous service 'get_local_data' for component 'atrv.pose' successfully registered\r\n[    0.462] [core.request_manager] Socket service manager: Synchronous service 'get_properties' for component 'atrv.pose' successfully registered\r\n[    0.462] [core.request_manager] Socket service manager: Synchronous service 'set_property' for component 'atrv.pose' successfully registered\r\n[    0.463] Component: 'atrv.pose' using middleware 'morse.middleware.socket_request_manager.SocketRequestManager' for services\r\n[    0.463] [core.request_manager] Socket service manager: Synchronous service 'get_configurations' for component 'atrv.motion' successfully registered\r\n[    0.463] [core.request_manager] Socket service manager: Synchronous service 'get_properties' for component 'atrv.motion' successfully registered\r\n[    0.463] [core.request_manager] Socket service manager: Synchronous service 'set_property' for component 'atrv.motion' successfully registered\r\n[    0.463] [core.request_manager] Socket service manager: Synchronous service 'set_speed' for component 'atrv.motion' successfully registered\r\n[    0.464] [core.request_manager] Socket service manager: Synchronous service 'stop' for component 'atrv.motion' successfully registered\r\n[    0.464] Component: 'atrv.motion' using middleware 'morse.middleware.socket_request_manager.SocketRequestManager' for services\r\n[    0.464] Component: 'atrv.collision' using datastream 'morse.middleware.socket_datastream.SocketDatastreamManager'\r\n[    0.464] [core.request_manager] Socket service manager: Synchronous service 'list_streams' for component 'simulation' successfully registered\r\n[    0.464] [core.request_manager] Socket service manager: Synchronous service 'get_stream_port' for component 'simulation' successfully registered\r\n[    0.464] [core.request_manager] Socket service manager: Synchronous service 'get_all_stream_ports' for component 'simulation' successfully registered\r\n[    0.464] \tDatastream interface 'morse.middleware.socket_datastream.SocketDatastreamManager' created\r\n[    0.465] [middleware.socket_datastream] Socket Mw Server now listening on port 60000 for component atrv.collision.\r\n[    0.465] Component: 'atrv.light' using datastream 'morse.middleware.socket_datastream.SocketDatastreamManager'\r\n[    0.465] [middleware.socket_datastream] Socket Mw Server now listening on port 60001 for component atrv.light.\r\n[    0.465] Component: 'atrv.pose' using datastream 'morse.middleware.socket_datastream.SocketDatastreamManager'\r\n[    0.465] [middleware.socket_datastream] Socket Mw Server now listening on port 60002 for component atrv.pose.\r\n[    0.466] Component: 'atrv.motion' using datastream 'morse.middleware.socket_datastream.SocketDatastreamManager'\r\n[    0.466] [middleware.socket_datastream] Socket Mw Server now listening on port 60003 for component atrv.motion.\r\n[    0.466] \r\n[    0.466] ------------------------------------\r\n[    0.466] -        SIMULATION SUMMARY        -\r\n[    0.466] ------------------------------------\r\n[    0.466] Robots in the simulation:\r\n[    0.467] \tROBOT: 'atrv'\r\n[    0.467] \t\t- Component: 'atrv.motion'\r\n[    0.467] \t\t- Component: 'atrv.pose'\r\n[    0.467] \t\t- Component: 'atrv.light'\r\n[    0.467] \t\t- Component: 'atrv.collision'\r\n[    0.467] \t\t- Component: 'atrv.battery'\r\n[    0.467] \t\t- Component: 'atrv.gripper'\r\n[    0.467] Available services:\r\n[    0.467] \t- Interface morse.middleware.socket_request_manager.SocketRequestManager\r\n[    0.467] \t\t- atrv.motion: ['set_property', 'set_speed', 'get_properties', 'stop', 'get_configurations']\r\n[    0.467] \t\t- simulation: ['set_camarafp_far_clip', 'list_streams', 'set_object_dynamics', 'deactivate', 'get_all_stream_ports', 'list_robots', 'details', 'reset_objects', 'get_scene_objects', 'set_log_level', 'set_object_visibility', 'set_camarafp_transform', 'set_camarafp_position', 'suspend_dynamics', 'quit', 'get_camarafp_projection_matrix', 'terminate', 'activate', 'get_stream_port', 'set_camarafp_projection_matrix', 'restore_dynamics']\r\n[    0.467] \t\t- atrv.pose: ['get_configurations', 'get_local_data', 'get_properties', 'set_property']\r\n[    0.467] \t\t- atrv.light: ['set_property', 'toggle', 'get_configurations', 'get_properties']\r\n[    0.468] \t\t- atrv.collision: ['get_properties', 'set_property', 'get_configurations', 'get_local_data']\r\n[    0.468] \t\t- time: ['sleep', 'now', 'statistics', 'mode']\r\n[    0.468] \t\t- communication: ['distance_and_view']\r\n[    0.468] Modifiers in use:\r\n[    0.468] \tNone\r\n[    0.468] \r\n[    0.468] Datastream interfaces configured:\r\n[    0.468] \t- 'morse.middleware.socket_datastream.SocketDatastreamManager'\r\n[    0.468] ------------------------------------\r\n[    0.468] \r\n[SCENE INITIALIZED]\r\n```\r\n\r\n---\r\n\r\n##### Installing morse\r\n```\r\n$ brew tap morse-simulator/morse\r\n$ brew install morse-simulator --with-ros --with-pymorse\r\n```\r\n\r\n##### Checking morse environment\r\n```\r\n$ morse check\r\n* Checking up your environment...\r\n* MORSE has only been tested on Linux. It may work\r\non other operating systems as well, but without any guarantee\r\n* Found MORSE libraries in '/usr/local/Cellar/morse-simulator/1.3/lib/python3.4/site-packages/morse/blender'. Alright.\r\n* Trying to figure out a prefix from the script location...\r\n* Default scene found. The prefix seems ok. Using it.\r\n* Setting $MORSE_ROOT environment variable to default prefix [/usr/local/]\r\n* Checking version of /Applications/Blender_2.75/blender.app/Contents/MacOS/blender... Found v.2.75.0\r\n* Version 2.75.0 of Blender is untested but should work\r\n* Blender found from $MORSE_BLENDER. Using it (Blender v.2.75.0)\r\n* Checking version of Python within Blender /Applications/Blender_2.75/blender.app/Contents/MacOS/blender... Found v.3.4.2\r\n* Blender and Morse are using Python 3.4.2. Alright.\r\n* Your environment is correctly setup to run MORSE.\r\n```\r\n\r\n##### Tutorial code with Proximity sensor\r\n```python\r\nfrom morse.builder import *\r\n\r\n# Land robot\r\natrv = ATRV()\r\n\r\n# Proximity sensor\r\n# AttributeError: 'AlwaysSensor' object has no attribute 'frequency'\r\nproximity = Proximity()\r\n\r\n# create a gripper\r\ngripper = Gripper()\r\ngripper.translate(z=.75, x=.3, y=0)\r\natrv.append(gripper)\r\n\r\n# create a battery sensor\r\nbattery = Battery()\r\nbattery.translate(z=.75, x=-.2, y=0)\r\natrv.append(battery)\r\n\r\n# creates a new collision sensor\r\ncollision = Collision()\r\ncollision.translate(z = .75, x = .2, y = 0)\r\natrv.append(collision)\r\n\r\n# Light actuator sensor\r\nlight = Light()\r\nlight.translate(z = 1)\r\natrv.append(light)\r\n\r\n# add a sensor\r\npose = Pose()\r\npose.translate(z = 0.75)\r\natrv.append(pose)\r\n\r\n# add an acuator\r\nmotion = MotionVW()\r\natrv.append(motion)\r\n\r\n# Scene configuration\r\ncollision.add_interface('socket')\r\nlight.add_interface('socket')\r\nmotion.add_service('socket')\r\nmotion.add_stream('socket')\r\npose.add_service('socket')\r\npose.add_stream('socket')\r\n\r\n# Environment configuration\r\nenv = Environment('indoors-1/boxes')\r\nenv.set_camera_location([5, -5, 6])\r\nenv.set_camera_rotation([1.0470, 0, 0.7854])\r\n```\r\n\r\n##### Client code\r\n```python\r\nfrom pymorse\r\n\r\ndef pose_received(pose):\r\n    print(\"The Robot is currently at %s\" % pose)\r\n\r\ndef main():\r\n\r\n    with pymorse() as morse:\r\n        morse.atrv.pose.subscribe(pose_received)\r\n        motion = morse.atrv.motion\r\n\r\n        v = 1.5\r\n        w = 1\r\n\r\n        while True:\r\n            motion.publish({\"v\": v, \"w\": w})\r\n\r\nif __name__ == \"__main__\":\r\n    main()\r\n```"}}