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

urdfのfake_*_linkとその接続を消したい #1

Open
Ar-Ray-code opened this issue Feb 12, 2024 · 0 comments
Open

urdfのfake_*_linkとその接続を消したい #1

Ar-Ray-code opened this issue Feb 12, 2024 · 0 comments

Comments

@Ar-Ray-code
Copy link
Member

Ar-Ray-code commented Feb 12, 2024

現在、auto_driver (自動機) のurdfはそれっぽいurdfになっているものの、接頭辞 fake が付く移動用のリンクが残っており、これを取り除く必要がある。

修正前

graph TD
A(base_frame)-->B(fake_1_to_2)
B-->C(yaw_link)
C-->D(fake_2_to_3)
D-->E(pitch_link)
Loading

修正後

graph TD
A(base_link)-->B(yaw_link)
B-->C(pitch_link)
Loading

削除される予定の行は以下の通り


現在のコミットでは、ros2_controlを使用する前提となっているため、編集中の軸は fixed で構わない(ブロードキャスト用GUIを使って正しく動いているか確認していただけると非常にありがたいです、)

ros2_controlを使わない場合、呼び出し元の auto_driver.urdf.xacro は次の通り

<?xml version="1.0"?>
<robot name="auto_driver" xmlns:xacro="http://ros.org/wiki/xacro">
  <xacro:include filename="$(find auto_driver_description)/urdf/auto_driver.xacro" />
  <link name="world"/>
  <xacro:auto_driver parent="world">
    <origin xyz="0 0 0" rpy="0 0 0" />
  </xacro:auto_driver>
</robot>

また、launch ( auto_driver.launch.py ) は次の通り

import os
from ament_index_python.packages import get_package_share_directory
from launch import LaunchDescription
from launch_ros.actions import Node
import xacro

def generate_launch_description():
    robot_name = "auto_driver"
    package_name = robot_name + "_description"
    rviz_config = os.path.join(get_package_share_directory(
        package_name), "launch", robot_name + ".rviz")
    robot_description = os.path.join(get_package_share_directory(
        package_name), "urdf", robot_name + ".urdf.xacro")
    robot_description_config = xacro.process_file(robot_description)

    return LaunchDescription([
        Node(
            package="robot_state_publisher",
            executable="robot_state_publisher",
            name="robot_state_publisher",
            parameters=[
                {"robot_description": robot_description_config.toxml()}],
            output="screen",
        ),

        Node(
            package="rviz2",
            executable="rviz2",
            name="rviz2",
            arguments=["-d", rviz_config],
            output="screen",
        )

    ])
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant