Ask Your Question
0

Warning: Invalid frame ID question for rviz2 (ROS2) [closed]

asked 2021-08-18 13:18:06 -0600

kak13 gravatar image

updated 2021-08-18 13:19:07 -0600

Question,

I seem I couldn't find any information, tutorial, or anything related to non-odom topic. odom is obviously different from wheel, a simple joint or anything that requires an integer value (or type of value)

So in my case, one joint called head which is (clipped head part only)

    <link name ="head">
        <visual>
            <geometry>
                <cylinder radius="0.01" length="0.02"/>
            </geometry>
        <material name="white"/>
        </visual>
        <collision>
            <geometry>
                <cylinder radius="0.01" length="0.02"/>
            </geometry>
    </collision>

    <xacro:cylinder_inertia m="1" r="0.01" h="0.02"/>

    </link>

The result is this

image description

So the question, for me or anyone else who approached to the same issue, is how do we correct it in a right way?

Let's say, if someone else made a joint called wheel, hand, or something simple (in my case, it's head)

What should we do to correct the issue? Do we need to update the launch? If so, which and what should we put?

Thank you for your time and efforts

edit retag flag offensive reopen merge delete

Closed for the following reason too subjective or argumentative by kak13
close date 2021-08-27 00:14:13.426609

1 Answer

Sort by ยป oldest newest most voted
0

answered 2021-08-18 13:21:20 -0600

kak13 gravatar image

In case if you need a full code

<?xml version="1.0"?>
<robot name="my_robot" xmlns:xacro="http://ros.org/wiki/xacro">

    <!--INCLUDE FILES-->
<!--    <xacro:include filename="$(find description)/my_robot.gazebo" />-->

  <!-- Define robot constants -->
  <xacro:property name="base_width" value="0.2159"/>
  <xacro:property name="base_length" value="0.1524"/>
  <xacro:property name="base_height" value="0.10795"/>

  <xacro:property name="wheel_radius" value="0.0325"/>
  <xacro:property name="wheel_width" value="0.02"/>
  <xacro:property name="wheel_ygap" value="0.088"/>
  <xacro:property name="wheel_zoff" value="0.05"/>
  <xacro:property name="wheel_xoff" value="0.1"/>

  <xacro:property name="caster_xoff" value="0.14"/>

  <!-- Define some commonly used intertial properties  -->
  <xacro:macro name="box_inertia" params="m w h d">
    <inertial>
      <origin xyz="0 0 0" rpy="${pi/2} 0 ${pi/2}"/>
      <mass value="${m}"/>
      <inertia ixx="${(m/12) * (h*h + d*d)}" ixy="0.0" ixz="0.0" iyy="${(m/12) * (w*w + d*d)}" iyz="0.0" izz="${(m/12) * (w*w + h*h)}"/>
    </inertial>
  </xacro:macro>

  <xacro:macro name="cylinder_inertia" params="m r h">
    <inertial>
      <origin xyz="0 0 0" rpy="${pi/2} 0 0" />
      <mass value="${m}"/>
      <inertia ixx="${(m/12) * (3*r*r + h*h)}" ixy = "0" ixz = "0" iyy="${(m/12) * (3*r*r + h*h)}" iyz = "0" izz="${(m/2) * (r*r)}"/>
    </inertial>
  </xacro:macro>

 <!-- Robot Base -->
  <link name="base_link">
    <visual>
      <geometry>
    <box size="0.2159 0.1524 0.10795"/>
      </geometry>
      <material name="Cyan">
    <color rgba="0 1.0 1.0 1.0"/>
      </material>
    </visual>
    <collision>
    <geometry>
        <box size="0.2159 0.1524 0.10795"/>
      </geometry>
    </collision>

    <xacro:box_inertia m="15" w="0.2159" d="0.1524" h="0.10795"/>
  </link>

  <!-- Robot Footprint -->
  <link name="base_footprint"/>

  <joint name="base_joint" type="fixed">
    <parent link="base_link"/>
    <child link="base_footprint"/>
    <origin xyz="0.0 0.0 ${-(wheel_radius+wheel_zoff)}" rpy="0 0 0"/>
  </joint>


    <!-- Servos -->
    <link name ="head">
        <visual>
            <geometry>
                <cylinder radius="0.01" length="0.02"/>
            </geometry>
        <material name="white"/>
        </visual>
        <collision>
            <geometry>
                <cylinder radius="0.01" length="0.02"/>
            </geometry>
    </collision>

    <xacro:cylinder_inertia m="1" r="0.01" h="0.02"/>

    </link>

    <link name ="head2">
    <visual>
        <geometry>
            <cylinder radius="0.01" length="0.02"/>
        </geometry>
        <material name="Gray">
            <color rgba="0.5 0.5 0.5 1.0"/>
        </material>
    </visual>
    <collision>
    <geometry>
        <cylinder radius="0.01" length="0.02"/>
    </geometry>
    </collision>
    <xacro:cylinder_inertia m="0" r="0.01" h="0.02"/>
    </link>

    <!-- Wheels -->
  <xacro:macro name="wheel" params="prefix x_reflect y_reflect">
    <link name="${prefix}_link">
      <visual>
    <origin xyz="0 0 0" rpy="${pi/2} 0 0"/>
    <geometry>
    <cylinder radius="${wheel_radius ...
(more)
edit flag offensive delete link more

Comments

Closing this due to the robot needs robot_description topic. Feel free to comment if you need more information even if you are in 2024 now

kak13 gravatar image kak13  ( 2021-08-27 00:13:38 -0600 )edit

Question Tools

2 followers

Stats

Asked: 2021-08-18 13:18:06 -0600

Seen: 86 times

Last updated: Aug 18 '21