Skip to content

Commit

Permalink
fix camera
Browse files Browse the repository at this point in the history
  • Loading branch information
rafal-gorecki committed Jan 30, 2024
1 parent 753364e commit f0ff7c1
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 7 deletions.
18 changes: 14 additions & 4 deletions rosbot_gazebo/config/gz_remappings.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -8,21 +8,31 @@
ros_type_name: sensor_msgs/msg/LaserScan
gz_type_name: ignition.msgs.LaserScan

- topic_name: <robot_namespace>/camera/camera_info
- topic_name: <robot_namespace>/camera/color/camera_info
ros_type_name: sensor_msgs/msg/CameraInfo
gz_type_name: ignition.msgs.CameraInfo
lazy: true

- topic_name: <robot_namespace>/camera/depth_image
- topic_name: <robot_namespace>/camera/color/image_raw
ros_type_name: sensor_msgs/msg/Image
gz_type_name: ignition.msgs.Image
lazy: true

- topic_name: <robot_namespace>/camera/image
- topic_name: <robot_namespace>/camera/depth/camera_info
ros_type_name: sensor_msgs/msg/CameraInfo
gz_type_name: ignition.msgs.CameraInfo
lazy: true

- topic_name: <robot_namespace>/camera/depth/image_raw
ros_type_name: sensor_msgs/msg/Image
gz_type_name: ignition.msgs.Image
lazy: true

- topic_name: <robot_namespace>/camera/points
- ros_topic_name: <robot_namespace>/camera/depth/points
gz_topic_name: <robot_namespace>/camera/depth/image_raw/points
ros_type_name: sensor_msgs/msg/PointCloud2
gz_type_name: ignition.msgs.PointCloudPacked
lazy: true

- topic_name: <robot_namespace>/range/fl
ros_type_name: sensor_msgs/msg/LaserScan
Expand Down
6 changes: 3 additions & 3 deletions rosbot_gazebo/test/test_utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -52,10 +52,10 @@ def __init__(self, name="test_node", namespace=None):

# Sensor callback
self.camera_rgb_sub = self.create_subscription(
Image, "camera/image", self.camera_image_callback, 10
Image, "camera/color/image_raw", self.camera_image_callback, 10
)
self.camera_pc_sub = self.create_subscription(
PointCloud2, "camera/points", self.camera_points_callback, 10
PointCloud2, "camera/depth/points", self.camera_points_callback, 10
)
self.range_subs = []
for range_topic_name in self.RANGE_SENSORS_TOPICS:
Expand Down Expand Up @@ -258,7 +258,7 @@ def yaw_speed_test(node: SimulationTestNode, v_x=0.0, v_y=0.0, v_yaw=0.0, robot_
), f"{robot_name} does not rotate properly. Check ekf_filter_node! Twist: {node.ekf_twist}"


def sensors_readings_test(node, robot_name="ROSbot"):
def sensors_readings_test(node: SimulationTestNode, robot_name="ROSbot"):
flag = node.scan_event.wait(timeout=20.0)
assert flag, f"{robot_name}'s lidar does not work properly!"

Expand Down

0 comments on commit f0ff7c1

Please sign in to comment.