Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[bug] Wrong Coordinate System #1092

Closed
2 of 4 tasks
G-Yong opened this issue Aug 10, 2023 · 2 comments
Closed
2 of 4 tasks

[bug] Wrong Coordinate System #1092

G-Yong opened this issue Aug 10, 2023 · 2 comments
Assignees
Labels
bug Something isn't working URDF

Comments

@G-Yong
Copy link

G-Yong commented Aug 10, 2023

(Please add appropriate labels)

  • Windows: (Version)
  • Linux: (Dist/Version)
  • ROS 1: Dist
  • ROS 2: Dist

<Version of the plugin>
v0.9.4

<Copy the Version information from the Help | About menu>
图片
Version: 1.81.0
Commit: 6445d93c81ebe42c4cbd7a60712e0b17d9463e97
Date: 2023-08-02T12:36:11.334Z
Electron: 22.3.18
ElectronBuildId: 22689846
Chromium: 108.0.5359.215
Node.js: 16.17.1
V8: 10.8.168.25-electron.0
OS: Linux x64 6.2.0-26-generic

what is the bug

<current behavior>
I am developing a project using ROS2 (humble) on Ubuntu 22.04.
When I write a urdf file and import it to display in rviz, the displayed model is inconsistent with the result shown in vscode.
图片

Repro steps

<how to reproduce the bug. Please attach sample files or github repo if appropriate.>
1.Use this urdf file.

`

<!-- Base link -->
<link name="base_link">
    <visual>
        <geometry>
            <box size="0.1 0.1 0.1"/>
        </geometry>
        <origin xyz="0 0 0.05" rpy="0 0 0" />
        <material name="blue">
            <color rgba="0 0 1.0 1"/>
        </material>
    </visual>
    <collision>
        <geometry>
            <box size="0.1 0.1 0.1"/>
        </geometry>
        <origin xyz="0 0 0.05" rpy="0 0 0"/>
    </collision>
    <!-- <inertial>
        <mass value="0"/>
        <inertia ixx="0" ixy="0" ixz="0" iyy="0" iyz="0" izz="0"/>
    </inertial> -->
</link>

<!-- Link 1 -->
<link name="link1">
    <visual>
        <geometry>
            <box size="0.25 0.08 0.02"/>
        </geometry>
        <origin xyz="0.125 0 0.01" rpy="0 0 0" />
        <material name="green">
            <color rgba="0 0.8 0 1"/>
        </material>
    </visual>
    <collision>
        <geometry>
            <box size="0.25 0.08 0.02"/>
        </geometry>
        <origin xyz="0.125 0 0.01" rpy="0 0 0" />
    </collision>
    <!-- <inertial>
        <mass value="0"/>
        <inertia ixx="0" ixy="0" ixz="0" iyy="0" iyz="0" izz="0"/>
    </inertial> -->
</link>

<!-- Joint 1: rotation around X-axis -1.57079-->
<joint name="joint1" type="revolute">
    <parent link="base_link"/>
    <child link="link1"/>
    <axis xyz="0 0 1"/>
    <!-- <origin xyz="0 0 0.1" rpy="0 0 0"/> -->
    <!-- <origin xyz="0 0.05 0.05" rpy="-1.57079 0 -1.57079"/> -->
    <origin xyz="0 0.05 0.05" rpy="-1.57079 -1.57079 0"/>
    <limit lower="-3.141592653" upper="3.141592653" effort="0" velocity="0"/>
</joint>

<!-- Link 2 -->
<link name="link2">
    <visual>
        <geometry>
            <box size="0.25 0.08 0.02"/>
        </geometry>
        <origin xyz="0.125 0 0.01" rpy="0 0 0" />
        <material name="red">
            <color rgba="1.0 0 0 1"/>
        </material>
    </visual>
    <collision>
        <geometry>
            <box size="0.25 0.08 0.02"/>
        </geometry>
        <origin xyz="0.125 0 0.01" rpy="0 0 0" />
    </collision>
    <!-- <inertial>
        <mass value="0"/>
        <inertia ixx="0" ixy="0" ixz="0" iyy="0" iyz="0" izz="0"/>
    </inertial> -->
</link>

<!-- Joint 2: rotation around Y-axis -->
<joint name="joint2" type="revolute">
    <parent link="link1"/>
    <child link="link2"/>
    <axis xyz="0 0 1"/>
    <origin xyz="0.25 0 0.02" rpy="0 0 3.141592653" />
    <limit lower="-3.141592653" upper="3.141592653" effort="0" velocity="0" />
</joint>

<!-- Link 3 -->
<link name="link3">
    <visual>
        <geometry>
            <box size="0.06 0.07 0.05"/>
        </geometry>
        <origin xyz="0.03 0 0.025" rpy="0 0 0" />
        <material name="yellow">
            <color rgba="0.8 0.8 0 1"/>
        </material>
    </visual>
    <collision>
        <geometry>
            <box size="0.06 0.07 0.05"/>
        </geometry>
        <origin xyz="0.03 0 0.025" rpy="0 0 0" />
    </collision>
    <!-- <inertial>
        <mass value="0"/>
        <inertia ixx="0" ixy="0" ixz="0" iyy="0" iyz="0" izz="0"/>
    </inertial> -->
</link>

<!-- Joint 3: rotation around x-axis -->
<joint name="joint3" type="revolute">
    <parent link="link2"/>
    <child link="link3"/>
    <axis xyz="0 0 1"/>
    <origin xyz="0.22 0 0.02"/>
    <limit lower="-3.141592653" upper="3.141592653" effort="0" velocity="0" />
</joint>

<!-- Link_indicator 用来辅助显示方向的-->
<link name="link_indicator">
    <visual>
        <geometry>
            <box size="0.05 0.025 0.025"/>
        </geometry>
        <origin xyz="0 0 0.0125" rpy="0 0 0"/>
        <!-- <material name="purple">
            <color rgba="1.0 0 1.0 1"/>
        </material> -->
        <material name="yellow">
            <color rgba="0.8 0.8 0 1"/>
        </material>
    </visual>
</link>
<joint name="joint_indicator" type="fixed">
    <parent link="link3"/>
    <child link="link_indicator"/>
    <origin xyz="0 0 0.05"/>
</joint>
`

2.To open and preview this URDF file using this plugin in vscode.
3.Somehow to display this urdf using rviz.
4.Comparison of models displayed in vscode and rviz

expected behavior

<what you would expect to happen>
In theory, the coordinates and relationships between links of the urdf model in this plugin should be consistent with the model displayed in rviz.

additional context

<any additional information would be helpful for a better understanding>
The displayed model in rviz is the desired effect I want.
I personally think that the reason for this bug may be the incorrect order of rpy(link's or/and joint's), i.e., the execution order of rotation angles for the x, y, and z axes.

@G-Yong G-Yong added the bug Something isn't working label Aug 10, 2023
@G-Yong G-Yong changed the title Wrong Coordinate System [bug]Wrong Coordinate System Aug 14, 2023
@G-Yong G-Yong changed the title [bug]Wrong Coordinate System [bug] Wrong Coordinate System Aug 14, 2023
@ooeygui
Copy link
Member

ooeygui commented Aug 30, 2023

I just released 0.9.5 which includes numerous fixes to this codepath. Can you check it out and see if this fixes it for you?

@ooeygui ooeygui self-assigned this Aug 30, 2023
@ooeygui ooeygui added the URDF label Aug 30, 2023
@G-Yong
Copy link
Author

G-Yong commented Aug 31, 2023

V0.9.5 works.

@G-Yong G-Yong closed this as completed Aug 31, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working URDF
Projects
None yet
Development

No branches or pull requests

2 participants