Ejemplo n.º 1
0
    def parse_collision(self, data):
        if self.is_connected:
            now = rospy.Time.now()
            collision = SpheroCollision()
            collision.header.stamp = now
            collision.x = data["X"]
            collision.y = data["Y"]
            collision.z = data["Z"]
            collision.axis = int(data["Axis"])
            collision.x_magnitude = data["xMagnitude"]
            collision.y_magnitude = data["yMagnitude"]
            collision.speed = data["Speed"]
            collision.timestamp = data["Timestamp"]

            self.collision = collision
            self.collision_pub.publish(self.collision)
Ejemplo n.º 2
0
 def parse_collision(self, data):
     if self.is_connected:
         now = rospy.Time.now()
         collision = SpheroCollision()
         collision.header.stamp = now
         collision.x = data["X"]
         collision.y = data["Y"]
         collision.z = data["Z"]
         collision.axis = int(data["Axis"])
         collision.x_magnitude = data["xMagnitude"]
         collision.y_magnitude = data["yMagnitude"]
         collision.speed = data["Speed"]
         collision.timestamp = data["Timestamp"]
         
         self.collision = collision
         self.collision_pub.publish(self.collision)