0
$\begingroup$

Rosanswers logo

Hi.

I'm asking this question after going through almost every thread with similar questions, but still unable to solve this issue. I'll elaborate all steps I'm doing to make it easy for troubleshooting.

I'm trying to run this package. I'm using two Logitech C270 USB cameras and the usb_cam package. The launch file looks like this:

<launch>
  <group ns="camera1">
    <node name="usb_cam1" pkg="usb_cam" type="usb_cam_node" output="screen" >
        <param name="video_device" value="/dev/video0" />
        <param name="image_width" value="640" />
        <param name="image_height" value="480" />
        <param name="pixel_format" value="yuyv" />
        <param name="camera_frame_id" value="yuyv" />
        <param name="io_method" value="mmap"/>
    </node>
    <node name="image_view" pkg="image_view" type="image_view" respawn="false" output="screen">
       <remap from="image" to="/camera1/usb_cam1/image_raw"/>
       <param name="autosize" value="true" />
    </node>
  </group>

  <group ns="camera2">
    <node name="usb_cam2" pkg="usb_cam" type="usb_cam_node" output="screen" >
      <param name="video_device" value="/dev/video1" />
      <param name="image_width" value="640" />
      <param name="image_height" value="480" />
      <param name="pixel_format" value="yuyv" />
      <param name="camera_frame_id" value="yuyv" />
     <param name="io_method" value="mmap"/>
   </node>
   <node name="image_view" pkg="image_view" type="image_view" respawn="false" output="screen">
     <remap from="image" to="/camera2/usb_cam2/image_raw"/>
     <param name="autosize" value="true" />
   </node>
  </group>
</launch>

Cameras are grabbing images and there's no issue. If I do a rostopic list I get these topics:

/camera1/image_view/output
/camera1/image_view/parameter_descriptions
/camera1/image_view/parameter_updates
/camera1/usb_cam1/camera_info
/camera1/usb_cam1/image_raw
/camera1/usb_cam1/image_raw/compressed
/camera1/usb_cam1/image_raw/compressed/parameter_descriptions
/camera1/usb_cam1/image_raw/compressed/parameter_updates
/camera1/usb_cam1/image_raw/compressedDepth
/camera1/usb_cam1/image_raw/compressedDepth/parameter_descriptions
/camera1/usb_cam1/image_raw/compressedDepth/parameter_updates
/camera1/usb_cam1/image_raw/theora
/camera1/usb_cam1/image_raw/theora/parameter_descriptions
/camera1/usb_cam1/image_raw/theora/parameter_updates
/camera2/image_view/output
/camera2/image_view/parameter_descriptions
/camera2/image_view/parameter_updates
/camera2/usb_cam2/camera_info
/camera2/usb_cam2/image_raw
/camera2/usb_cam2/image_raw/compressed
/camera2/usb_cam2/image_raw/compressed/parameter_descriptions
/camera2/usb_cam2/image_raw/compressed/parameter_updates
/camera2/usb_cam2/image_raw/compressedDepth
/camera2/usb_cam2/image_raw/compressedDepth/parameter_descriptions
/camera2/usb_cam2/image_raw/compressedDepth/parameter_updates
/camera2/usb_cam2/image_raw/theora
/camera2/usb_cam2/image_raw/theora/parameter_descriptions
/camera2/usb_cam2/image_raw/theora/parameter_updates
/rosout
/rosout_agg

Now I run the nodes as described in the README file here. When I run rviz , I get these

No tf data. Actual error: Fixed Frame [map] does not exist

So I used gmapping as pointed out here

rosrun gmapping slam_gmapping

this time I do get Global Status: Ok Fixed Frame: Ok .

Now I can add a new display of the topic /camera_left_rect/disparity_map and disparity map is shown without any problem.

But if I add a new display of the topic /camera_left_rect/point_cloud (where point cloud is the output) I get this error:

Transform [sender=unknown_publisher] For frame [jackal]: Frame [jackal] does not exist

I did rosrun tf view_frames and the output is this.

Where am I doing wrong? Please help.


Originally posted by OneLeggedPirate on ROS Answers with karma: 21 on 2017-06-12

Post score: 1


Original comments

Comment by gvdhoorn on 2017-06-13:
Could you please attach your view_frames sshot to this post directly? I've given you enough karma to do so. Thanks.

$\endgroup$

2 Answers 2

0
$\begingroup$

Rosanswers logo

As is apparent from your view_frames output, you are not running any TF broadcaster.

RViz needs at least one TF authority in order to be able to transform incoming msgs such as pointclouds and other things that have a position in 3D space (ie: the visualiser window) into its scene graph properly.

You configure the root of the transformation tree that RViz is supposed to use with the Fixed Frame setting, which in your case if set to map. But without anyone publishing a transform from map to whatever frame_id is configured in the incoming msgs that is not going to work.

Two options:

  1. add a static_tf_publisher to your launch file that sets up a proper TF tree for all frames involved
  2. change the Fixed Frame setting to correspond to any of the frames that are used by any of the incoming msgs (just select the field and type the name of the frame in the textbox)

The proper approach would be 1, but to quickly visualise something, 2 would work.


Edit: and unless you actually want to do some robot localisation and / or map building, I would not bother with gmapping (or any of the related pkgs).


Originally posted by gvdhoorn with karma: 86574 on 2017-06-13

This answer was NOT ACCEPTED on the original site

Post score: 3


Original comments

Comment by OneLeggedPirate on 2017-06-13:
For option 1, how do I add a static_tf_publisher ?

P.S: If I do not use gmapping, I get No tf data. Actual error: Fixed Frame [map] does not exist . In this case, view_frames returns no tf data received

Comment by gvdhoorn on 2017-06-13:
It would probably be good if you could provide us with a bit more context. Right now it's a unclear whether you are trying to create a static setup (ie: two webcams with a computer on your desk), or whether you are trying to configure a mobile robot base. The former doesn't need gmapping ..

Comment by gvdhoorn on 2017-06-13:
.., for the latter it might make sense, but only if you're creating a map. Otherwise I'd use a localisation package.

But just to reiterate: gmapping is not a requirement for getting a TF tree setup.

Comment by OneLeggedPirate on 2017-06-13:
I'm just using a static setup at the moment.

Comment by gvdhoorn on 2017-06-14:
Ok. Then adding a TF tree isn't that difficulty. No need for gmapping. Either create a urdf that describes how you've setup things (ie: relative position of the two cameras, etc), or take a look at wiki/tf - static_transform_publisher.

Comment by BotLover on 2017-09-16:
I am also doing the same thing. I have 2 webcameras connected to my pc and later I want to mount them on a small rover which will navigate based on the disparity/depth map image. However I am stuck at tf broadcaster issue. Can you elaborate on how to solve the issue??@OneLeggedPirate

Comment by Will Chamberlain on 2018-03-26:
e.g. if your robot base tf is /base_link and your /camera_left_rect/point_cloud topic has frame_id:cam_left_ptcloud you need something like

rosrun tf static_transform_publisher 0.0 0.0 0.0 0 0 0 /base_link cam_left_ptcloud 100

; that static tf node then acts as the 'tf authority' .

Comment by Will Chamberlain on 2018-03-26:
... e.g. https://answers.ros.org/question/221329/rviz-fixed-frame-map-does-not-exist/?answer=221357

$\endgroup$
0
$\begingroup$

Rosanswers logo

these helped me

sudo apt install ros-humble-gazebo-ros
sudo apt-get install ros-humble-gazebo-msgs
sudo apt-get install ros-humble-gazebo-plugins

Originally posted by bharath5673 with karma: 11 on 2023-01-28

This answer was NOT ACCEPTED on the original site

Post score: 1

$\endgroup$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.