def get_dispatch_msg(self, action): dispatch_msg = plan_dispatch_msgs.ActionDispatch() arg_msg = diag_msgs.KeyValue() arg_msg.key = 'bot' arg_msg.value = self.robot_name dispatch_msg.parameters.append(arg_msg) if action.intention == 'go': dispatch_msg.name = 'move_base' for slot in action.slots: arg_msg = diag_msgs.KeyValue() if slot.type == 'destination': arg_msg.key = 'to' arg_msg.value = slot.data dispatch_msg.parameters.append(arg_msg) elif action.intention == 'take': for slot in action.slots: arg_msg = diag_msgs.KeyValue() if slot.type == 'object': arg_msg.key = 'obj' elif slot.type == 'source': dispatch_msg.name = 'pick' arg_msg.key = 'surface' elif slot.type == 'destination': dispatch_msg.name = 'place' arg_msg.key = 'surface' arg_msg.value = slot.data dispatch_msg.parameters.append(arg_msg) return dispatch_msg
def get_dispatch_msg(self, obj_name, surface_name): dispatch_msg = plan_dispatch_msgs.ActionDispatch() dispatch_msg.name = self.action_name arg_msg = diag_msgs.KeyValue() arg_msg.key = 'bot' arg_msg.value = self.robot_name dispatch_msg.parameters.append(arg_msg) arg_msg = diag_msgs.KeyValue() arg_msg.key = 'obj' arg_msg.value = obj_name dispatch_msg.parameters.append(arg_msg) arg_msg = diag_msgs.KeyValue() arg_msg.key = 'plane' arg_msg.value = surface_name dispatch_msg.parameters.append(arg_msg) arg_msg = diag_msgs.KeyValue() arg_msg.key = 'context' arg_msg.value = self.grasping_context dispatch_msg.parameters.append(arg_msg) return dispatch_msg
def get_dispatch_msg(self): dispatch_msg = plan_dispatch_msgs.ActionDispatch() dispatch_msg.name = self.action_name arg_msg = diag_msgs.KeyValue() arg_msg.key = 'bot' arg_msg.value = self.robot_name dispatch_msg.parameters.append(arg_msg) return dispatch_msg
def get_dispatch_msg(self, original_location, destination_location): dispatch_msg = plan_dispatch_msgs.ActionDispatch() dispatch_msg.name = self.action_name arg_msg = diag_msgs.KeyValue() arg_msg.key = 'bot' arg_msg.value = self.robot_name dispatch_msg.parameters.append(arg_msg) arg_msg = diag_msgs.KeyValue() arg_msg.key = 'from' arg_msg.value = original_location dispatch_msg.parameters.append(arg_msg) arg_msg = diag_msgs.KeyValue() arg_msg.key = 'to' arg_msg.value = destination_location dispatch_msg.parameters.append(arg_msg) return dispatch_msg