ROS Resources: Documentation | Support | Discussion Forum | Index | Service Status | ros @ Robotics Stack Exchange
Ask Your Question
0

aruco_detect /fiducial_transform not giving any transforms when using USB camera

asked 2021-12-09 08:14:00 -0500

Roshan gravatar image

updated 2021-12-09 09:17:02 -0500

Hello, I have been trying to set up a camera on a real turtlebot. The raspi_cam did not work at all, didn't even give pictures, so instead I attached a USB camera to the robot. The USB camera is working, and I have tried using the aruco_detect package with it. The aruco_detect package shows that a marker is being detected in RQT, and the /fiducial_vertices topic shows that it detects the vertices in the camera. The problem is that the /fiducial_transform does not give any transforms, and I think this could be because I'm using a usb camera, as in the simulations it was working as intended.

Thhis is the launch file for the actual implementation right now, launched from the robot:

<launch>
   <include file="$(find turtlebot3_bringup)/launch/turtlebot3_robot.launch" ns="tb3_0">
  </include>

  <arg name="model" default="waffle_pi"/>
  <arg name="first_tb3" default="tb3_0"/>

  <node pkg = "cv_camera" type="cv_camera_node" name="cv_camera" output="screen">
   <param name="image_width" value="640"/>
   <param name="image_heigth" value="480"/>
   <param name="rate" value="60"/>
   </node>

  <node pkg="tf" type="static_transform_publisher" name="camera_frames_pub" args="0.05 0.0 0.1 0 0 0 tb3_0/base_link /camera 35"/>

     <!-- Start marker detector-->
 <node name="aruco_detect" pkg="aruco_detect" type="aruco_detect">
    <param name="image_transport" value="compressed" />
    <param name="publish_images" value="true" />
    <param name="fiducial_len" value="0.15" />
    <param name="dictionary" value="0" />
    <param name="do_pose_estimation" value="true" />
    <param name="ignore_fiducials" value="" />
    <param name="fiducial_len_override" value="" />
    <remap from="/camera/compressed" to="/cv_camera/image_raw/compressed"/>
    <remap from="/camera_info" to="/cv_camera/camera_info"/>
  </node>

 <group ns = "$(arg first_tb3)">
    <param name="robot_description" command="$(find xacro)/xacro --inorder '$(find turtlebot3_description)/urdf/turtlebot3_$(arg model).urdf.xacro' botname:=$(arg firs>

     <node pkg="robot_state_publisher" type="robot_state_publisher" name="robot_state_publisher" output="screen">
      <param name="publish_frequency" type="double" value="50.0" />
      <param name="tf_prefix" value="$(arg first_tb3)" />
    </node>
 </group>
 </launch>

In the simulations, instead of:

<remap from="/camera/compressed" to="/cv_camera/image_raw/compressed"/>
<remap from="/camera_info" to="/cv_camera/camera_info"/>

there was:

<remap from="/camera/compressed" to="/tb3_1/camera/rgb/image_raw/compressed"/>
<remap from="/camera_info" to="/tb3_1/camera/rgb/camera_info"/>

and this could be where the issue is. In the simulations a /fiducial transform would show up in the tf tree under the RGB optical frame as shown in the image below, but this does not happen here.

https://answers.ros.org/upfiles/16336...

Wondering how I would make this fiducial transform show up now that I'm using a USB camera instead.

I did try to go into the /opt/ros/noetic/share/turtlebot3_description/urdf on the robot and edit the turtlebot3_waffle_pi.gazebo.xacro so that:

  <plugin name="camera_controller" filename="libgazebo_ros_camera.so">
    <alwaysOn>true</alwaysOn>
    <updateRate>30.0</updateRate>
    <cameraName>camera</cameraName>
    <frameName>camera_rgb_optical_frame</frameName>
    <imageTopicName>rgb/image_raw</imageTopicName>
    <cameraInfoTopicName>rgb/camera_info</cameraInfoTopicName>

is

  <plugin name="camera_controller" filename="libgazebo_ros_camera.so">
    <alwaysOn>true</alwaysOn>
    <updateRate>30.0</updateRate>
    <cameraName>camera</cameraName>
    <frameName>camera_rgb_optical_frame</frameName>
    <imageTopicName>/cv_camera/image_raw< ...
(more)
edit retag flag offensive close merge delete

Comments

Linking the Github question on this too, since a lot of stuff was tried there: https://github.com/UbiquityRobotics/f...

Roshan gravatar image Roshan  ( 2021-12-09 16:05:14 -0500 )edit

1 Answer

Sort by ยป oldest newest most voted
0

answered 2021-12-10 05:39:28 -0500

Roshan gravatar image

USB camera was not calibrated. It has to be calibrated for the /fiducial_transform to work.

edit flag offensive delete link more

Question Tools

1 follower

Stats

Asked: 2021-12-09 08:14:00 -0500

Seen: 127 times

Last updated: Dec 10 '21