refactoring urdfs, update launchers

This commit is contained in:
Björn Ellensohn 2023-07-31 09:51:32 +02:00
parent da2b09a236
commit cc4cdacb28
5 changed files with 66 additions and 41 deletions

View File

@ -4,7 +4,7 @@
<joint name="camera_joint" type="fixed"> <joint name="camera_joint" type="fixed">
<parent link="chassis"/> <parent link="chassis"/>
<child link="camera_link"/> <child link="camera_link"/>
<origin xyz="0.276 0 0.181" rpy="0 0.18 0"/> <origin xyz="0.276 0 0.181" rpy="0 0 0"/>
</joint> </joint>
<link name="camera_link"> <link name="camera_link">

View File

@ -110,7 +110,7 @@
<joint name="left_wheel_joint" type="continuous"> <joint name="left_wheel_joint" type="continuous">
<parent link="base_link"/> <parent link="base_link"/>
<child link="left_wheel"/> <child link="left_wheel"/>
<origin xyz="0 ${wheel_offset_y} 0" rpy="-${pi/2} 0 0" /> <origin xyz="${chassis_length/2 - 0.070} ${wheel_offset_y/2 + wheel_thickness/2 + 0.01} 0" rpy="-${pi/2} 0 0" />
<axis xyz="0 0 1"/> <axis xyz="0 0 1"/>
</joint> </joint>
@ -143,7 +143,7 @@
<joint name="right_wheel_joint" type="continuous"> <joint name="right_wheel_joint" type="continuous">
<parent link="base_link"/> <parent link="base_link"/>
<child link="right_wheel"/> <child link="right_wheel"/>
<origin xyz="0 ${-wheel_offset_y} 0" rpy="${pi/2} 0 0" /> <origin xyz="${chassis_length/2 - 0.070} -${wheel_offset_y/2 + wheel_thickness/2 + 0.01} 0" rpy="${pi/2} 0 0" />
<axis xyz="0 0 -1"/> <axis xyz="0 0 -1"/>
</joint> </joint>
@ -206,7 +206,7 @@
<joint name="lidar_joint" type="fixed"> <joint name="lidar_joint" type="fixed">
<parent link="chassis"/> <parent link="chassis"/>
<child link="laser_frame"/> <child link="laser_frame"/>
<origin xyz="-150 0 30"/> <origin xyz="${chassis_length -0.150} 0 ${chassis_height + 0.030}" rpy="0 0 0"/>
</joint> </joint>
@ -229,8 +229,6 @@
<gazebo reference="laser_frame"> <gazebo reference="laser_frame">
<material>Gazebo/White</material> <material>Gazebo/White</material>
<mu1 value="0.001"/>
<mu2 value="0.001"/>
</gazebo> </gazebo>
</robot> </robot>

View File

@ -1,35 +0,0 @@
from launch import LaunchDescription
from launch_ros.actions import Node
from launch.substitutions import LaunchConfiguration
from launch.actions import DeclareLaunchArgument
import os
from ament_index_python.packages import get_package_share_directory
def generate_launch_description():
use_sim_time = LaunchConfiguration('use_sim_time')
joy_params = os.path.join(get_package_share_directory('segway_rmp220_support'),'config','joystick.yaml')
joy_node = Node(
package='joy',
executable='joy_node',
parameters=[joy_params, {'use_sim_time': use_sim_time}],
)
teleop_node = Node(
package='teleop_twist_joy',
executable='teleop_node',
name='teleop_node',
parameters=[joy_params, {'use_sim_time': use_sim_time}],
remappings=[('/cmd_vel','/cmd_vel_joy')]
)
return LaunchDescription([
DeclareLaunchArgument(
'use_sim_time',
default_value='false',
description='Use sim time if true'),
joy_node,
teleop_node,
])

View File

@ -0,0 +1,62 @@
# Copyright 2022 Factor Robotics
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
import os
from launch import LaunchDescription
from launch.substitutions import Command, FindExecutable, PathJoinSubstitution
from launch_ros.actions import Node
from launch_ros.substitutions import FindPackageShare
from ament_index_python.packages import get_package_share_directory
from launch_ros.actions import LifecycleNode
from launch_ros.descriptions import ParameterValue
from launch.substitutions import LaunchConfiguration
def generate_launch_description():
robot_description_content = Command(
[
PathJoinSubstitution([FindExecutable(name="xacro")]),
" ",
PathJoinSubstitution(
[
FindPackageShare("cps_rmp220_support"),
"description",
"robot.urdf.xacro"
]
),
]
)
use_sim_time = False
slam_params_file = PathJoinSubstitution(
[
FindPackageShare("bot_mini_bringup"),
"config",
"mapper_params_online_async.yaml"
]
)
mapper_node = Node(
package="slam_toolbox",
executable="async_slam_toolbox_node",
name='slam_toolbox_node',
output='screen',
parameters=[
slam_params_file,
{'use_sim_time': use_sim_time}
],
)
return LaunchDescription([
mapper_node
])