Is it possible to set one header message equal to another header message?
Is it possible to set one header message equal to another header message? Or do I have to set all the data manually?
e.g. self.OccupancyGrid.header.stamp = last_message.header.stamp self.OccupancyGrid.header.frame_id = last_message.header.frame_id
THIS IS HOW I WANT TO DO IT (SEE THE CODE BELOW): self.OccupancyGrid = OccupancyGrid() self.OccupancyGrid.header = Header() self.OccupancyGrid.info = MapMetaData() self.OccupancyGrid.data = []
--some more code ---
last_message = self.map_msg_queue[-1] self.OccupancyGrid.header = last_message.header self.OccupancyGrid.info = last_message.info