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

Object recognition object detected but wrong position

asked 2022-02-09 08:02:25 -0500

ROS_newbie gravatar image

updated 2022-02-22 11:14:18 -0500

lucasw gravatar image

While trying to set up object recognition on a robot created in fusion 360 using the find_object_2d package, Iam able to detect my object (coke can); however, when i open rviz, the tf of the object is recognized as above the camera rather than in front of it. Below is my urdf and 3d detection launch file. URDF:

<gazebo reference="camera_1">

<gazebo reference="camera_1">
   <sensor name="camera_1" type="depth">
  <plugin name="camera_1_controller" filename="">

</sensor> </gazebo>

  <link name="camera_1">
     <origin rpy="0 0 0" xyz="0.012500000000000011 0.0 0.0"/>
     <mass value="0.3575"/>
     <inertia ixx="0.001266" ixy="0.0" ixz="0.0" iyy="9.3e-05" iyz="0.0" izz="0.00121"/>
    <origin rpy="0 0 0" xyz="-0.25 -0.0 -0.15"/>
    <mesh filename="package://moodz_description/meshes/camera_1.stl" scale="0.001 0.001 0.001"/>
    <material name="silver"/>
   <origin rpy="0 0 0" xyz="-0.25 -0.0 -0.15"/>
  <mesh filename="package://moodz_description/meshes/camera_1.stl" scale="0.001 0.001 0.001"/>

<joint name="Rigid4" type="fixed"> <origin rpy="0 0 0" xyz="0.25 0.0 0.15"/> <parent link="base_link"/> <child link="camera_1"/> </joint> Launch Files: 3d Object_Recognition:

<node name="find_object_3d" pkg="find_object_2d" type="find_object_2d" output="screen">
    <param name="gui" value="true" type="bool"/>
    <param name="settings_path" value="~/.ros/find_object_2d.ini" type="str"/>
    <param name="subscribe_depth" value="true" type="bool"/>
    <param name="session_path" value="$(find obj_detection)/sessions/coke_session.bin" type="str"/>
    <param name="objects_path" value="" type="str"/>
    <param name="object_prefix" value="object" type="str"/>
    <remap from="rgb/image_rect_color" to="/camera_1/color/image_raw"/>
    <remap from="depth_registered/image_raw" to="/camera_1/depth/image_raw"/>
    <remap from="depth_registered/camera_info" to="/camera_1_ir/depth/camera_info"/>
<!-- Example of tf synchronisation with the objectsStamped message <node name="tf_example" pkg="find_object_2d" type="tf_example" output="screen">
    <param name="map_frame_id" value="/camera_1" type="string"/>
    <param name="object_prefix" value="object" type="str"/>
    <param command="$(find xacro)/xacro $(find moodz_description)/urdf/moodz.xacro" name="robot_description"/>
    <node args="-param robot_description -urdf -model moodz" name="spawn_urdf" pkg="gazebo_ros ...
edit retag flag offensive close merge delete



Added points. Can you pls add the image to your question. Thank you

osilva gravatar image osilva  ( 2022-02-09 08:14:24 -0500 )edit

Image can now be viewed

ROS_newbie gravatar image ROS_newbie  ( 2022-02-09 12:21:18 -0500 )edit

1 Answer

Sort by ยป oldest newest most voted

answered 2022-05-23 15:08:35 -0500

ROS_newbie gravatar image

updated 2022-05-24 10:48:29 -0500

This was solved by publishing a static transform between the camera and base_link according to the following command to your launch file: <node pkg="tf" type="static_transform_publisher" name="tf" args="0 0 0 -1.58 0 -1.58 base_link camera_1 100"/> This publishes a transform from your base_link to camera_link and rotates according to the above angles.

edit flag offensive delete link more

Question Tools

1 follower


Asked: 2022-02-09 08:02:25 -0500

Seen: 106 times

Last updated: May 24 '22