Skip to content

Commit

Permalink
marker color fixed
Browse files Browse the repository at this point in the history
  • Loading branch information
mgonzs13 committed Apr 30, 2024
1 parent 731f56b commit 1fd5f85
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 9 deletions.
6 changes: 3 additions & 3 deletions yolov8_ros/yolov8_ros/debug_node.py
Original file line number Diff line number Diff line change
Expand Up @@ -205,9 +205,9 @@ def create_bb_marker(self, detection: Detection, color: Tuple[int]) -> Marker:
marker.scale.y = bbox3d.size.y
marker.scale.z = bbox3d.size.z

marker.color.b = float(color[0])
marker.color.g = float(color[1])
marker.color.r = float(color[2])
marker.color.b = color[0] / 255.0
marker.color.g = color[1] / 255.0
marker.color.r = color[2] / 255.0
marker.color.a = 0.4

marker.lifetime = Duration(seconds=0.5).to_msg()
Expand Down
9 changes: 3 additions & 6 deletions yolov8_ros/yolov8_ros/yolov8_node.py
Original file line number Diff line number Diff line change
Expand Up @@ -59,8 +59,6 @@ def __init__(self, **kwargs) -> None:
self.declare_parameter("image_reliability",
QoSReliabilityPolicy.BEST_EFFORT)

self.declare_parameter("input_image_topic", "image_raw")

self.get_logger().info('Yolov8Node created')

def on_configure(self, state: LifecycleState) -> TransitionCallbackReturn:
Expand Down Expand Up @@ -88,9 +86,6 @@ def on_configure(self, state: LifecycleState) -> TransitionCallbackReturn:
depth=1
)

self.topic_name = self.get_parameter(
"input_image_topic").get_parameter_value().string_value

self._pub = self.create_lifecycle_publisher(
DetectionArray, "detections", 10)
self._srv = self.create_service(
Expand All @@ -113,7 +108,9 @@ def on_activate(self, state: LifecycleState) -> TransitionCallbackReturn:

# subs
self._sub = self.create_subscription(
Image, self.topic_name, self.image_cb,
Image,
"image_raw",
self.image_cb,
self.image_qos_profile
)

Expand Down

0 comments on commit 1fd5f85

Please sign in to comment.