Newer
Older
orange2022 / src / zlac8015d_ros / launch / motor_driver_node.launch
@koki koki on 14 Dec 2022 2 KB last commit
<?xml version="1.0"?>
<launch>
 <!-- Arguments -->
  <arg name="port"                default="/dev/ttyUSB0"/>
  <!--# Control mode
      # 1: relative position control mode
      # Default: Subscribe to "/zlac8015d/pos/cmd_deg" and "/zlac8015d/pos/cmd_dist"
      # 3: Speed rpm control mode
      # Default: Subscribe to "/zlac8015d/twist/cmd_vel", "/zlac8015d/vel/cmd_vel" and "/zlac8015d/vel/cmd_rpm"-->
  <arg name="control_mode"        default="3"/>
  <arg name="debug"               default="false"/>
  <arg name="twist_cmd_vel_topic" default="/zlac8015d/twist/cmd_vel"/>
  <arg name="cmd_vel_topic"       default="/zlac8015d/vel/cmd_vel"/>
  <arg name="cmd_rpm_topic"       default="/zlac8015d/vel/cmd_rpm"/>
  <arg name="cmd_deg_topic"       default="/zlac8015d/pos/cmd_deg"/>
  <arg name="cmd_dist_topic"      default="/zlac8015d/pos/cmd_dist"/>

  <arg name="publish_TF"          default="true"/>
  <arg name="TF_header_frame"     default="odom"/>
  <arg name="TF_child_frame"      default="base_link"/>

  <arg name="publish_odom"        default="true"/>
  <arg name="odom_header_frame"   default="odom"/>
  <arg name="odom_child_frame"    default="base_link"/>

  <!-- Motor driver -->
  <node name="motor_driver_node" pkg="zlac8015d_ros" type="motor_driver_node.py" output="screen">
    <param name="port"                value="$(arg port)"/>
    <param name="control_mode"        value="$(arg control_mode)"/>
    <param name="debug"               value="$(arg debug)"/>
    <param name="twist_cmd_vel_topic" value="$(arg twist_cmd_vel_topic)"/>
    <param name="cmd_vel_topic"       value="$(arg cmd_vel_topic)"/>
    <param name="cmd_rpm_topic"       value="$(arg cmd_rpm_topic)"/>
    <param name="cmd_deg_topic"       value="$(arg cmd_deg_topic)"/>
    <param name="cmd_dist_topic"      value="$(arg cmd_dist_topic)"/>
    <param name="publish_TF"          value="$(arg publish_TF)"/>
    <param name="TF_header_frame"     value="$(arg TF_header_frame)"/>
    <param name="TF_child_frame"      value="$(arg TF_child_frame)"/>
    <param name="publish_odom"        value="$(arg publish_odom)"/>
    <param name="odom_header_frame"   value="$(arg odom_header_frame)"/>
    <param name="odom_child_frame"    value="$(arg odom_child_frame)"/>
    <rosparam command="load" file="$(find zlac8015d_ros)/params/motor_driver_params.yaml"/>
  </node>
</launch>