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

Camera sensor not correctly attached to the robot joint. How to fix it?

asked 2021-04-05 04:03:56 -0500

Astronaut gravatar image

updated 2021-04-05 21:35:06 -0500

Hi

Im using ZED camera and darkner_ros package to detect objects. As a robot, I have build Tower Crane model, but when attaching the ZED camera to the robot the objects are not placed correctly. In the Moveit Scene, the origin of the ZED Camera is in the crane base but it should be in the hook block just above the load (that is the crane_block). The TF tree shows correctly but still, the RVIZ simulation is not correct.

Here the RVIZ and the TF image description

Here the ZED launch file

<?xml version="1.0"?>
<launch>
    <!-- Camera Model -->
    <arg name="node_name"             default="zed_node" />

    <!-- Camera Model -->
    <arg name="camera_model"          default="zed" /> <!-- 'zed' or 'zedm' -->

    <!-- Load SVO file -->
    <arg name="svo_file"              default="" /><!-- <arg name="svo_file" default="path/to/svo/file.svo"> -->
    <!-- Remote stream -->
    <arg name="stream"                default="" /> <!-- <arg name="stream" default="<ip_address>:<port>"> -->

    <!-- Publish ZED urdf -->
    <arg name="publish_urdf"          default="true" />

    <arg name="camera_id"             default="-1" />
    <arg name="gpu_id"                default="-1" />

    <group ns="zed">
        <!-- ROS URDF description of the ZED -->
        <group if="$(arg publish_urdf)">
            <param name="zed_description" textfile="$(find zed_wrapper)/urdf/$(arg camera_model).urdf" />
            <node name="zed_state_publisher" pkg="robot_state_publisher" type="robot_state_publisher">
                <remap from="robot_description" to="zed_description" />
            </node>
        </group>

        <node name="$(arg node_name)" pkg="zed_wrapper" type="zed_wrapper_node" output="screen" required="true"><!-- launch-prefix="valgrind" -->
            <rosparam file="$(find zed_wrapper)/params/common.yaml" command="load" />
            <rosparam file="$(find zed_wrapper)/params/$(arg camera_model).yaml" command="load" />

            <!-- SVO file path -->
            <param name="svo_file"          value="$(arg svo_file)" />

            <!-- Remote stream -->
            <param name="stream"            value="$(arg stream)" />

            <!-- Publish ZED urdf -->
            <param name="tracking/publish_tf"        value="false" />
            <param name="tracking/publish_map_tf"    value="false" />

            <!-- Camera ID -->
            <param name="general/zed_id"             value="$(arg camera_id)" />

            <!-- GPU ID -->
            <param name="general/gpu_id"             value="$(arg gpu_id)" />
        </node>
     </group>

  <node pkg="tf"  type="static_transform_publisher" name="zed_left_camera_optical_frame"  args="0 0 0 0 0 0  crane_block base_link 100" /> 

</launch>

And the ZED URDF File

<?xml version="1.0"?>
<robot name="zed_camera">
<!-- base_link -->
    <link name="base_link" />

<!-- Camera Center -->
    <joint name="zed_camera_center_joint" type="fixed">
        <parent link="base_link"/>
        <child link="zed_camera_center"/>
        <origin xyz="0 0 0" rpy="0 0 0" />
    </joint>

    <link name="zed_camera_center">
        <visual>
            <origin xyz="0 0 0" rpy="0 0 0"/>
            <geometry>
                <mesh filename="package://zed_wrapper/urdf/models/ZED.stl" />
            </geometry>
            <material name="light_grey">
                <color rgba="0.8 0.8 0.8 0.8"/>
            </material>
        </visual>
    </link>

<!-- Left Camera -->

    <joint name="zed_left_camera_joint" type="fixed">
        <parent link="zed_camera_center"/>
        <child link="zed_left_camera_frame"/>
        <origin xyz="0 0.06 0" rpy="0 0 0" />
    </joint>

    <link name="zed_left_camera_frame" />

    <joint name="zed_left_camera_optical_joint" type="fixed">
        <origin xyz ...
(more)
edit retag flag offensive close merge delete

Comments

Have you made any progress with this? I have the same problem when I attach the zed to my base. My tf tree is correct but the origins are not correctly represented in rviz.

sentry_26 gravatar image sentry_26  ( 2021-06-10 19:59:37 -0500 )edit

Yes, solve it. In the ZED launch the transform was not correct.

Astronaut gravatar image Astronaut  ( 2021-09-02 22:03:19 -0500 )edit

Hi, our team is working on a similar project. May I ask if we can use your urdf file to model the crane? We can also pay you a price if it is within our budget. Thanks!

yimzh gravatar image yimzh  ( 2021-12-28 00:43:09 -0500 )edit

you can email me. Or I can email you. What is your email?

Astronaut gravatar image Astronaut  ( 2022-02-24 01:06:42 -0500 )edit

1 Answer

Sort by ยป oldest newest most voted
0

answered 2022-02-27 06:38:08 -0500

yimzh gravatar image

updated 2022-02-27 07:51:32 -0500

you can reach me via yimeng.zhu0821@gmail.com

We have made some progress so far. The links and joints are already modeled as some basic geometry. It's just a 3 dof robot arm. May I ask how you got the mesh for the whole tower crane?

Also, did you model the rope successfully in your case? Can it work as intented?

Thanks

edit flag offensive delete link more

Question Tools

3 followers

Stats

Asked: 2021-04-05 04:03:56 -0500

Seen: 264 times

Last updated: Feb 27 '22