I am trying to make a short script in Python that would give me the battery charge as well as the battery status (in charge or not in charge) and the state (on/off) of NAO robots in a given local network.

To do that I am looking for a list of all variables (including sensor variables) that characterizes my NAO robot. I found the list of all callable events and a list of Memory Keys but no variable list. I am looking in particuliar for a BatteryCharge variable if such a variable exists.

Does such a list exist? If not, how should I proceed to do what I want?

有帮助吗?

解决方案 3

Thank you everyone for your answers, but I found a way to get the complete list of data accessible through an ALMemory proxy.

print("ALMemory device keys...") for key in memoryProxy.getDataListName(): print(key) print("\n\n")

So the variable I was looking for was indeed Device/SubDeviceList/Battery/Charge/Sensor/Value

其他提示

I found this on Aldebaran's website...

int getBatteryLevel ()

Get the battery level (0..5) 5: full 0: totally empty (never reached). Returns the battery level (0..5): 5: full 0: totally empty (never reached)

string getBatteryLevelDesc ()

Get a text presentation of the battery level ('My battery is...'). Returns the sentence describing the battery level

Let me know if it helps

There's no list, but you can get access in one call to a list of wanted variable. eg:

mem = ALProxy( "ALMemory" )
listData = [
              "Device/SubDeviceList/Battery/Current/Sensor/Value",
              "Device/SubDeviceList/Battery/Charge/Sensor/Status",
              "Device/SubDeviceList/Battery/Charge/Sensor/Value",
           ]

listVal = mem.getListData( listData )
许可以下: CC-BY-SA归因
不隶属于 StackOverflow
scroll top