OpenAgricultureFoundation / openag_brain

ROS package for controlling an OpenAg food computer
GNU General Public License v3.0
221 stars 68 forks source link

light_illuminance variable is missing in openag.var_types #37

Closed yaromins closed 8 years ago

yaromins commented 8 years ago

I'm experimenting with writing a driver for cheap light sensor based on Bh1750 chip . All seams to be working fine and I even see lux reading in OpenAg UI.

Just minor issue I've found looking in logs:

2016-09-04T07:50:49.260454659Z [WARN] [WallTime: 1472975449.259701] Cloning into 'openag_bh1750'... 2016-09-04T07:50:49.619175349Z [WARN] [WallTime: 1472975449.618340] Encountered a module output that references a non-existant variable: Output "light_illuminance" of module "bh1750_1" 2016-09-04T07:50:51.696040275Z [WARN] [WallTime: 1472975451.695208] Cloning into 'openag_firmware_module'... 2016-09-04T07:50:54.135100866Z [WARN] [WallTime: 1472975454.134453] Cloning into 'openag_am2315'... 2016-09-04T07:51:23.426972246Z [WARN] [WallTime: 1472975483.426506] Copyright (c) 2000-2005

Looking at code I suspect that light_illuminance is missing in EnvVr (openag.var_types)

valid_vars = list(EnvVar.items.keys())
for module_id, module_info in modules.items():
    for output_name, output_info in module_info["outputs"].items():
        if not output_info["variable"] in valid_vars:
            rospy.logwarn(
                "Encountered a module output that references a "
                'non-existant variable: Output "%s" of module "%s"',
                output_name, module_id
            )
            continue
gordonbrander commented 8 years ago

Yeah this seems to be the case. @LeonChambers do you have a preference for what this variable should be? light_illuminance?

In the meantime, the warn won't hurt anything. We just put those in place so that folks are encouraged toward using the same environmental variable names. That way data can be usefully compared.

LeonChambers commented 8 years ago

Yea, light_illuminance is fine

gordonbrander commented 8 years ago

Fixed by https://github.com/OpenAgInitiative/openag_python/pull/3.