in tools/rossim/rosigen.py [0:0]
def get_value(self, path):
try:
msg = self._vals[path[0]]
for i in range(1, len(path)):
if self._is_list(msg):
match = re.match(r"^\[(\d+)\]$", path[i])
if not match:
raise Exception("error: invalid index")
msg = msg[int(match.groups(1)[0])]
else:
msg = getattr(msg, path[i])
return msg
except Exception:
print("error: invalid path")
raise