microsoft / Azure_Kinect_ROS_Driver

A ROS sensor driver for the Azure Kinect Developer Kit.
MIT License
304 stars 226 forks source link

Fixed compressed image format for image_transport compatibility #146

Closed iory closed 4 years ago

iory commented 4 years ago

Fixes

Description of the changes:

Before submitting a Pull Request:

I tested changes on:

The result of this PR as follows.

$ rostopic echo /k4a/rgb/image_raw/compressed --noarr -n1
header:
  seq: 22
  stamp:
    secs: 1595593360
    nsecs: 195937704
  frame_id: "rgb_camera_link"
format: "bgra8; jpeg compressed bgr8"
data: "<array type: uint8, length: 615359>"
---
ooeygui commented 4 years ago

Hi @iory, Thank you for your contribution. Can you tell me how this manifested as a problem?

iory commented 4 years ago

I am taking data with rosbag and analyzing images and save those as the compressed images for data reduction. This PR's change is necessary because I am reading the value of format to detect if the image contained in the rosbag is compressed. Following code is a sample of format parsing function.

def compressed_format(msg):
    fmt, compr_type = msg.format.split(';')
    # remove white space
    fmt = fmt.strip()
    return fmt, compr_type
ooeygui commented 4 years ago

Sorry for the delay on this.

iory commented 4 years ago

Thank you!