def data_callback()

in simulation_ws/src/robot_fleet/scripts/gazebo_model_mover.py [0:0]


    def data_callback(self, msg):
        """ This is the callback that gets called by data from all robots. We just update a datastructure
            with the latest data, and create an entry if it doesn't exist."""
        data = json.loads(msg.data)

        # Ignore data from current robot since it's already available
        if data['name'] == self.robot_name:
            pass
        elif self.all_data.get( data['name'], None) is None:
            self.create_model(data['name'], data['robot_sdf_file'], data['gazebo_pose'] )
            if self.use_custom_move_plugin:
                self.all_data[data['name']] = [ data, rospy.Time.now(), self.create_pub(data['name']) ]
            else:
                self.all_data[data['name']] = [ data, rospy.Time.now() ]
        else:
            self.all_data[data['name']][0] = data
            self.all_data[data['name']][1] = rospy.Time.now()