Robotics StackExchange | Archived questions

Messege is published but not recieved by rviz

I sliced by image frames to numpy arrays in float 32. It seemsto be published as my going through the commands like rostopic hz/echo. But it doesnot display any visual results on rviz or foxglove.

r = frame[:,:,2] # frame is incoming images and r shows only red channel extracted from it
pub1.publish(br.cv2_to_imgmsg(r)) # br = CvBridge()
red_img= numpy.zeros(frame.shape)
red_img[:,:,2] = r
a = numpy.array(red_img, dtype=numpy.float32)
pub11.publish(a)

Asked by ridaaa on 2022-10-06 01:19:05 UTC

Comments

Answers

Please add a minimal reproducible example. We can not see how your variables are initialized and used, such as frame, pub11, br, etc.

However, based on the snippet above, it seems that you are not setting a header, such as frame_id to your image. Please set those important metadata before visualizing in RViz.

Asked by ravijoshi on 2022-10-11 02:46:49 UTC

Comments