Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1 +1,2 @@
*.swp
**/**/compile_commands.json
80 changes: 80 additions & 0 deletions vesc_ackermann/launch/ackermann_to_vesc_node.launch.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,80 @@
# Copyright 2020 F1TENTH Foundation
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are met:
#
# * Redistributions of source code must retain the above copyright
# notice, this list of conditions and the following disclaimer.
#
# * Redistributions in binary form must reproduce the above copyright
# notice, this list of conditions and the following disclaimer in the
# documentation and/or other materials provided with the distribution.
#
# * Neither the name of the {copyright_holder} nor the names of its
# contributors may be used to endorse or promote products derived from
# this software without specific prior written permission.
#
# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
# AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
# IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
# ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
# LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
# CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
# SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
# INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
# CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
# ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
# POSSIBILITY OF SUCH DAMAGE.

import os

from ament_index_python.packages import get_package_share_directory
from launch import LaunchDescription
from launch.actions import DeclareLaunchArgument
from launch.substitutions import LaunchConfiguration
from launch_ros.actions import Node


def generate_launch_description():

# Get default config file.
vesc_ackermann_config = os.path.join(
get_package_share_directory('vesc_ackermann'),
'params',
'ackermann_to_vesc_config.yaml'
)

# Create the launch configuration variables
config_yaml = LaunchConfiguration("config")
log_level = LaunchConfiguration('log_level')

declare_log_level_cmd = DeclareLaunchArgument(
'log_level', default_value='info',
description='log level')

declare_config_yaml_cmd = DeclareLaunchArgument(
name="config",
default_value=vesc_ackermann_config,
description="Ackermann to vesc configuration file.",
)

# Specify the actions
start_vesc_ackermann_cmd = Node(
package='vesc_ackermann',
executable='ackermann_to_vesc_node',
name='ackermann_to_vesc_node',
parameters=[config_yaml],
arguments=['--ros-args', '--log-level', log_level],
)

# Create the launch description and populate
ld = LaunchDescription()

# Declare the launch options
ld.add_action(declare_config_yaml_cmd)
ld.add_action(declare_log_level_cmd)

# Add the action to launch the node
ld.add_action(start_vesc_ackermann_cmd)

return ld
14 changes: 0 additions & 14 deletions vesc_ackermann/launch/ackermann_to_vesc_node.launch.xml

This file was deleted.

80 changes: 80 additions & 0 deletions vesc_ackermann/launch/vesc_to_odom_node.launch.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,80 @@
# Copyright 2020 F1TENTH Foundation
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are met:
#
# * Redistributions of source code must retain the above copyright
# notice, this list of conditions and the following disclaimer.
#
# * Redistributions in binary form must reproduce the above copyright
# notice, this list of conditions and the following disclaimer in the
# documentation and/or other materials provided with the distribution.
#
# * Neither the name of the {copyright_holder} nor the names of its
# contributors may be used to endorse or promote products derived from
# this software without specific prior written permission.
#
# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
# AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
# IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
# ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
# LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
# CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
# SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
# INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
# CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
# ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
# POSSIBILITY OF SUCH DAMAGE.

import os

from ament_index_python.packages import get_package_share_directory
from launch import LaunchDescription
from launch.actions import DeclareLaunchArgument
from launch.substitutions import LaunchConfiguration
from launch_ros.actions import Node


def generate_launch_description():

# Get default config file.
vesc_ackermann_config = os.path.join(
get_package_share_directory('vesc_ackermann'),
'params',
'vesc_to_odom_config.yaml'
)

# Create the launch configuration variables
config_yaml = LaunchConfiguration("config")
log_level = LaunchConfiguration('log_level')

declare_log_level_cmd = DeclareLaunchArgument(
'log_level', default_value='info',
description='log level')

declare_config_yaml_cmd = DeclareLaunchArgument(
name="config",
default_value=vesc_ackermann_config,
description="Vesc to odom configuration file.",
)

# Specify the actions
start_vesc_to_odom_cmd = Node(
package='vesc_ackermann',
executable='vesc_to_odom_node',
name='vesc_to_odom_node',
parameters=[config_yaml],
arguments=['--ros-args', '--log-level', log_level],
)

# Create the launch description and populate
ld = LaunchDescription()

# Declare the launch options
ld.add_action(declare_config_yaml_cmd)
ld.add_action(declare_log_level_cmd)

# Add the action to launch the node
ld.add_action(start_vesc_to_odom_cmd)

return ld
19 changes: 0 additions & 19 deletions vesc_ackermann/launch/vesc_to_odom_node.launch.xml

This file was deleted.

6 changes: 6 additions & 0 deletions vesc_ackermann/params/ackermann_to_vesc_config.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
/**:
ros__parameters:
speed_to_erpm_gain: 4614.0 # ERPM/(m/s)
speed_to_erpm_offset: 0.0 # ERPM
steering_angle_to_servo_gain: -1.2135 # ppm/rad
steering_angle_to_servo_offset: 0.5304 # ppm
11 changes: 11 additions & 0 deletions vesc_ackermann/params/vesc_to_odom_config.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
/**:
ros__parameters:
speed_to_erpm_gain: 1.0 # ERPM/(m/s)
speed_to_erpm_offset: 0.0 # ERPM
steering_angle_to_servo_gain: 1.0 # ppm/rad
steering_angle_to_servo_offset: 0.2 # ppm
odom_frame: "odom"
base_frame: "base_link"
use_servo_cmd_to_calc_angular_velocity: True
wheelbase: 0.2 # m
publish_tf: True
43 changes: 32 additions & 11 deletions vesc_driver/launch/vesc_driver_node.launch.py
Original file line number Diff line number Diff line change
Expand Up @@ -37,22 +37,43 @@

def generate_launch_description():

vesc_config = os.path.join(
# Get default config file.
config = os.path.join(
get_package_share_directory('vesc_driver'),
'params',
'vesc_config.yaml'
'config.yaml'
)
return LaunchDescription([
DeclareLaunchArgument(

# Create the launch configuration variables
config_yaml = LaunchConfiguration("config")
log_level = LaunchConfiguration('log_level')

declare_log_level_cmd = DeclareLaunchArgument(
'log_level', default_value='info',
description='log level')

declare_config_yaml_cmd = DeclareLaunchArgument(
name="config",
default_value=vesc_config,
description="VESC yaml configuration file.",
),
Node(
default_value=config,
description="Vesc driver configuration file.",
)

start_vesc_driver_cmd = Node(
package='vesc_driver',
executable='vesc_driver_node',
name='vesc_driver_node',
parameters=[LaunchConfiguration("config")]
),
parameters=[config_yaml],
arguments=['--ros-args', '--log-level', log_level],
)

# Create the launch description and populate
ld = LaunchDescription()

# Declare the launch options
ld.add_action(declare_config_yaml_cmd)
ld.add_action(declare_log_level_cmd)

# Add the action to launch the node
ld.add_action(start_vesc_driver_cmd)

])
return ld
File renamed without changes.