From caaad1353a8a7b3c2c04e80d2895fd1ee0772a84 Mon Sep 17 00:00:00 2001
From: Dmytro <dimazez@ukr.net>
Date: Wed, 16 Dec 2020 15:49:28 +0200
Subject: [PATCH 1/2] Added ssc interface launch file, fixed novatel launch
 file

---
 .../launch/drivers/novatel.launch.py          |  4 +-
 .../launch/drivers/ssc_interface.launch.py    | 82 +++++++++++++++++++
 .../launch/platform.launch.py                 |  8 ++
 .../param/ssc_interface.param.yaml            | 25 ++++++
 4 files changed, 117 insertions(+), 2 deletions(-)
 create mode 100644 src/vehicle_platform/launch/drivers/ssc_interface.launch.py
 create mode 100644 src/vehicle_platform/param/ssc_interface.param.yaml

diff --git a/src/vehicle_platform/launch/drivers/novatel.launch.py b/src/vehicle_platform/launch/drivers/novatel.launch.py
index a6fdad9..63a1a0f 100644
--- a/src/vehicle_platform/launch/drivers/novatel.launch.py
+++ b/src/vehicle_platform/launch/drivers/novatel.launch.py
@@ -17,7 +17,7 @@ def generate_launch_description():
                 node_name='novatel_gps',
                 parameters=[{
                     'connection_type': 'tcp',
-                    'device': '192.168.74.10:2000',
+                    'device': '192.168.100.150:3004',
                     'verbose': False,
                     'publish_novatel_positions': True,
                     'publish_novatel_velocity': True,
@@ -35,4 +35,4 @@ def generate_launch_description():
         output='screen'
     )
 
-    return LaunchDescription([container])
\ No newline at end of file
+    return LaunchDescription([container])
diff --git a/src/vehicle_platform/launch/drivers/ssc_interface.launch.py b/src/vehicle_platform/launch/drivers/ssc_interface.launch.py
new file mode 100644
index 0000000..136aa65
--- /dev/null
+++ b/src/vehicle_platform/launch/drivers/ssc_interface.launch.py
@@ -0,0 +1,82 @@
+# Copyright 2020 The Autoware Foundation
+#
+# 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.
+
+from launch import LaunchDescription
+from launch.substitutions import LaunchConfiguration
+from launch.actions import DeclareLaunchArgument
+from launch_ros.actions import Node
+from ament_index_python import get_package_share_directory
+import os
+
+
+def get_share_file(package_name, file_name):
+    return os.path.join(get_package_share_directory(package_name), file_name)
+
+
+def generate_launch_description():
+    """
+    Launch necessary dependencies for working with AutonomouStuff SSC and ROS 2/Autoware.Auto.
+
+    The SSC interface, which translates inputs and outputs to and from Autoware messages.
+    """
+    # --------------------------------- Params -------------------------------
+
+    # In combination 'raw', 'basic' and 'high_level' control
+    # in what mode of control comands to operate in,
+    # only one of them can be active at a time with a value
+    control_command_param = DeclareLaunchArgument(
+        'control_command',
+        default_value="basic",  # use "raw", "basic" or "high_level"
+        description='command control mode')
+
+    # Default ssc_interface params
+    ssc_interface_param = DeclareLaunchArgument(
+        'ssc_interface_param',
+        default_value=[
+            get_share_file('vehicle_platform', 'param/ssc_interface.param.yaml')
+        ],
+        description='Path to config file for SSC interface')
+
+    # -------------------------------- Nodes-----------------------------------
+
+    # SSC interface
+    ssc_interface = Node(
+        package='ssc_interface',
+        node_name='ssc_interface_node',
+        node_executable='ssc_interface_node_exe',
+        node_namespace='vehicle',
+        output='screen',
+        parameters=[LaunchConfiguration('ssc_interface_param')],
+        remappings=[
+            ('gear_select', '/ssc/gear_select'),
+            ('arbitrated_speed_commands', '/ssc/arbitrated_speed_commands'),
+            ('arbitrated_steering_commands', '/ssc/arbitrated_steering_commands'),
+            ('turn_signal_command', '/ssc/turn_signal_command'),
+            ('dbw_enabled_feedback', '/ssc/dbw_enabled_fedback'),
+            ('gear_feedback', '/ssc/gear_feedback'),
+            ('velocity_accel_cov', '/ssc/velocity_accel_cov'),
+            ('steering_feedback', '/ssc/steering_feedback'),
+            ('vehicle_kinematic_state_cog', '/vehicle/vehicle_kinematic_state'),
+            ('state_report_out', '/vehicle/vehicle_state_report'),
+            ('state_command', '/vehicle/vehicle_state_command')
+        ]
+    )
+
+    ld = LaunchDescription([
+        control_command_param,
+        ssc_interface_param,
+        ssc_interface
+    ])
+    return ld
+
diff --git a/src/vehicle_platform/launch/platform.launch.py b/src/vehicle_platform/launch/platform.launch.py
index 9aff5ec..b4cda6d 100644
--- a/src/vehicle_platform/launch/platform.launch.py
+++ b/src/vehicle_platform/launch/platform.launch.py
@@ -51,9 +51,17 @@ def generate_launch_description():
         PythonLaunchDescriptionSource(pacmod_driver_path)
     )
 
+    ssc_interface_driver_path = get_share_file(
+        package_name='vehicle_platform',
+        file_name='launch/drivers/ssc_interface.launch.py')
+    ssc_interface_driver = IncludeLaunchDescription(
+        PythonLaunchDescriptionSource(ssc_driver_path)
+    )
+
     return LaunchDescription([
         robot_state_publisher,
         novatel_driver,
         velodyne_driver,
         pacmod_driver,
+        ssc_driver
     ])
diff --git a/src/vehicle_platform/param/ssc_interface.param.yaml b/src/vehicle_platform/param/ssc_interface.param.yaml
new file mode 100644
index 0000000..98d3681
--- /dev/null
+++ b/src/vehicle_platform/param/ssc_interface.param.yaml
@@ -0,0 +1,25 @@
+/**:
+  ros__parameters:
+    cycle_time_ms: 10
+    # Only one of the three control command topics need be specified
+    # "raw", "basic" or "high_level"
+    control_command: "basic"
+    ssc:
+      front_axle_to_cog: 1.228
+      rear_axle_to_cog: 1.5618
+      max_yaw_rate: 1.5708
+    state_machine:
+      gear_shift_velocity_threshold_mps: 0.5
+      acceleration_limits:
+        min: -5.0
+        max: 15.0
+        threshold: 1.0
+      front_steer_limits:
+        min: -0.533
+        max: 0.533
+        threshold: 0.3
+      time_step_ms: 100
+      timeout_acceleration_mps2: 3.0
+      state_transition_timeout_ms: 3000
+      gear_shift_accel_deadzone_mps2: 0.5
+
-- 
GitLab


From 9332a6855b538fc5824ffeafb57094ff63249bfe Mon Sep 17 00:00:00 2001
From: Dmytro <dimazez@ukr.net>
Date: Wed, 16 Dec 2020 15:52:37 +0200
Subject: [PATCH 2/2] Typo fix

---
 src/vehicle_platform/launch/platform.launch.py | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/src/vehicle_platform/launch/platform.launch.py b/src/vehicle_platform/launch/platform.launch.py
index b4cda6d..573211a 100644
--- a/src/vehicle_platform/launch/platform.launch.py
+++ b/src/vehicle_platform/launch/platform.launch.py
@@ -63,5 +63,5 @@ def generate_launch_description():
         novatel_driver,
         velodyne_driver,
         pacmod_driver,
-        ssc_driver
+        ssc_interface_driver
     ])
-- 
GitLab