Skip to content

Commit

Permalink
Update auto2024.launch.py and package.xml***
Browse files Browse the repository at this point in the history
***Update auto2024.launch.py to include new imports and parameters. Update package.xml to add new dependencies.
  • Loading branch information
Ar-Ray-code committed Feb 24, 2024
1 parent a245bd7 commit 846878c
Show file tree
Hide file tree
Showing 4 changed files with 54 additions and 19 deletions.
56 changes: 43 additions & 13 deletions auto_driver_bringup/launch/auto2024.launch.py
Original file line number Diff line number Diff line change
@@ -1,10 +1,23 @@
from ament_index_python.packages import get_package_share_directory
import launch
from launch.actions import DeclareLaunchArgument
from launch.substitutions import LaunchConfiguration
from launch_ros.actions import ComposableNodeContainer
from launch_ros.descriptions import ComposableNode
from launch_ros.actions import Node

import os
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 launch.LaunchDescription([
ComposableNodeContainer(
name='auto_driver_interface',
Expand All @@ -19,7 +32,7 @@ def generate_launch_description():
namespace='can_node/gm6020_0',
parameters=[
{'p': 50},
{'i': 30},
{'i': 10},
{'d': 5},
{'max_spd': 8000},
{'init_deg': 120},
Expand All @@ -34,8 +47,8 @@ def generate_launch_description():
name='yaw_motor',
namespace='can_node/gm6020_1',
parameters=[
{'p': 100},
{'i': 30},
{'p': 50},
{'i': 10},
{'d': 5},
{'max_spd': 8000},
{'init_deg': 180},
Expand Down Expand Up @@ -74,13 +87,14 @@ def generate_launch_description():
name='topic_to_tf_base_to_tf0',
namespace='can_node/gm6020_1',
parameters=[
{'center_offset': -90.0},
{'from_frame_id': 'base_link'},
{'to_frame_id': 'tf0'},
{'center_offset': -180.0},
{'from_frame_id': 'fake_1_to_2'},
{'to_frame_id': 'yaw_link'},
{'target_angle_axis': "yaw"},
{'offset_x': 0.0},
{'offset_y': 0.0},
{'offset_z': 0.0}
{'offset_z': 0.0},
{'invert_degree': False}
]
),
ComposableNode(
Expand All @@ -89,15 +103,31 @@ def generate_launch_description():
name='topic_to_tf_tf0_to_tf1',
namespace='can_node/gm6020_0',
parameters=[
{'center_offset': -180.0},
{'from_frame_id': 'tf0'},
{'to_frame_id': 'tf1'},
{'target_angle_axis': "pitch"},
{'center_offset': -120.0},
{'from_frame_id': 'fake_2_to_3'},
{'to_frame_id': 'pitch_link'},
{'target_angle_axis': "roll"},
{'offset_x': 0.0},
{'offset_y': 0.0},
{'offset_z': 0.15}
{'offset_z': 0.0},
{'invert_degree': True}
]
),
)
],
),
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",
)
])
5 changes: 5 additions & 0 deletions auto_driver_bringup/package.xml
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,11 @@

<buildtool_depend>ament_cmake_auto</buildtool_depend>

<exec_depend>joint_state_publisher</exec_depend>
<exec_depend>robot_state_publisher</exec_depend>
<exec_depend>rviz2</exec_depend>
<exec_depend>xacro</exec_depend>

<test_depend>ament_lint_auto</test_depend>
<test_depend>ament_lint_common</test_depend>

Expand Down
4 changes: 2 additions & 2 deletions auto_driver_description/urdf/auto_driver.urdf.xacro
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
<?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" />
<xacro:include filename="$(find auto_driver_description)/urdf/auto_driver.ros2_control.xacro" />
<!-- <xacro:include filename="$(find auto_driver_description)/urdf/auto_driver.ros2_control.xacro" /> -->

<link name="world"/>

<xacro:auto_driver parent="world">
<origin xyz="0 0 0" rpy="0 0 0" />
</xacro:auto_driver>

<xacro:auto_driver_ros2_control name="auto_driver_ros2_control" />
<!-- <xacro:auto_driver_ros2_control name="auto_driver_ros2_control" /> -->
</robot>
8 changes: 4 additions & 4 deletions auto_driver_description/urdf/auto_driver.xacro
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@
<joint name="fake_1_to_2_joint" type="fixed">
<parent link="base_frame" />
<child link="fake_1_to_2" />
<origin xyz="0 0 0.18" rpy="0 0 0" />
<origin xyz="0 0 0.18" rpy="0 0 -1.57079632679" />
</joint>


Expand Down Expand Up @@ -82,12 +82,12 @@
<joint name="fake_2_to_3_joint" type="fixed">
<parent link="yaw_link" />
<child link="fake_2_to_3" />
<origin xyz="0 0 0" rpy="-1.57079632679 0 0" />
<origin xyz="0 0 0.19" rpy="0 0 0" />
</joint>

<link name="pitch_link">
<visual>
<origin xyz="0 0 0.019" rpy="0 0 0"/>
<origin xyz="0 0 -0.19" rpy="0 0 0"/>
<geometry>
<mesh filename="package://auto_driver_description/meshes/gimbal_pitch_link.stl" scale="0.001 0.001 0.001"/>
</geometry>
Expand All @@ -114,7 +114,7 @@
<parent link="fake_2_to_3"/>
<child link="pitch_link"/>
<origin xyz="0.0 0.0 0.005" rpy="0 0 0"/>
<axis xyz="1 0 0"/>
<axis xyz="-1 0 0"/>
<limit velocity="4.8" effort="1" lower="0.0" upper="2.0" />
</joint>

Expand Down

0 comments on commit 846878c

Please sign in to comment.