Port to Jazzy ros2_control.
authorWalter Fetter Lages <w.fetter@ieee.org>
Mon, 2 Dec 2024 02:59:35 +0000 (23:59 -0300)
committerWalter Fetter Lages <w.fetter@ieee.org>
Mon, 2 Dec 2024 02:59:35 +0000 (23:59 -0300)
27 files changed:
q2d_bringup/CMakeLists.txt
q2d_bringup/config/bypass.yaml
q2d_bringup/config/computed_torque.yaml
q2d_bringup/config/group_bypass.yaml [deleted file]
q2d_bringup/config/group_pid.yaml [deleted file]
q2d_bringup/config/joint_state_broadcaster.yaml [new file with mode: 0644]
q2d_bringup/config/pid.yaml
q2d_bringup/config/pid_plus_gravity.yaml [deleted file]
q2d_bringup/launch/bypass.launch.xml
q2d_bringup/launch/computed_torque.launch.xml
q2d_bringup/launch/gazebo.launch.xml
q2d_bringup/launch/group_bypass.launch.xml [deleted file]
q2d_bringup/launch/group_pid.launch.xml [deleted file]
q2d_bringup/launch/hardware.launch.xml
q2d_bringup/launch/pid.launch.xml
q2d_bringup/launch/pid_plus_gravity.launch.xml [deleted file]
q2d_bringup/scripts/ijc_square.py
q2d_bringup/scripts/ijc_step.sh
q2d_bringup/scripts/torque_step.sh [moved from q2d_bringup/scripts/group_torque_step.sh with 54% similarity]
q2d_description/CMakeLists.txt
q2d_description/config/gz_bridge.yaml [new file with mode: 0644]
q2d_description/env-hooks/q2d_description.dsv.in [deleted file]
q2d_description/launch/display.launch.py
q2d_description/launch/display.launch.xml
q2d_description/launch/gazebo.launch.xml
q2d_description/urdf/q2d.urdf
q2d_teleop/launch/gazebo.launch.xml

index 3b6c960..c2aed6d 100644 (file)
@@ -11,7 +11,7 @@ find_package(ament_cmake REQUIRED)
 install(PROGRAMS
        scripts/ijc_step.sh
        scripts/ijc_square.py
-       scripts/group_torque_step.sh
+       scripts/torque_step.sh
        scripts/joint_trajectory_step.sh
        DESTINATION lib/${PROJECT_NAME}
 )
index 29d9a17..52309c1 100644 (file)
@@ -1,11 +1,6 @@
-shoulder_controller:
+bypass_controller:
         ros__parameters:
-                joints:
+                type: effort_controllers/JointGroupEffortController
+                joints: 
                         - shoulder_active_joint
-                interface_name: effort
-
-elbow_controller:
-        ros__parameters:
-                joints:
                         - elbow_active_joint
-                interface_name: effort
index c16f2f0..6168684 100644 (file)
@@ -1,5 +1,6 @@
 computed_torque_controller:
         ros__parameters:
+                type: computed_torque_controller/ComputedTorqueController
                 joints: 
                         - shoulder_active_joint
                         - elbow_active_joint
diff --git a/q2d_bringup/config/group_bypass.yaml b/q2d_bringup/config/group_bypass.yaml
deleted file mode 100644 (file)
index 0413e10..0000000
+++ /dev/null
@@ -1,5 +0,0 @@
-group_bypass:
-        ros__parameters:
-                joints: 
-                        - shoulder_active_joint
-                        - elbow_active_joint
diff --git a/q2d_bringup/config/group_pid.yaml b/q2d_bringup/config/group_pid.yaml
deleted file mode 100644 (file)
index 1bcbd0b..0000000
+++ /dev/null
@@ -1,7 +0,0 @@
-group_controller:
-        ros__parameters:
-                joints:
-                        - shoulder_active_joint
-                        - elbow_active_joint
-                shoulder_active_joint/pid: {p: 2310, i: 4640, d: 0.299}
-                elbow_active_joint/pid: {p: 339, i: 851, d: 0.351}
diff --git a/q2d_bringup/config/joint_state_broadcaster.yaml b/q2d_bringup/config/joint_state_broadcaster.yaml
new file mode 100644 (file)
index 0000000..29015ca
--- /dev/null
@@ -0,0 +1,3 @@
+joint_state_broadcaster:
+        ros__parameters:
+                type: joint_state_broadcaster/JointStateBroadcaster
index 962b7f6..61ee10a 100644 (file)
@@ -1,9 +1,11 @@
-shoulder_controller:
+pid_controller:
         ros__parameters:
-                joint: shoulder_active_joint
-                pid: {p: 2310, i: 4640, d: 0.299}
-
-elbow_controller:
-        ros__parameters:
-                joint: elbow_active_joint
-                pid: {p: 339, i: 851, d: 0.351}
+                type: pid_controller/PidController
+                dof_names:
+                        - shoulder_active_joint
+                        - elbow_active_joint
+                command_interface: effort
+                reference_and_state_interfaces: ["position"]
+                gains:
+                        shoulder_active_joint: {p: 2310.0, i: 4640.0, d: 0.299, i_clamp_max: 100.0, i_clamp_min: -100.0, antiwindup: false}
+                        elbow_active_joint: {p: 339.0, i: 841.0, d: 0.351, i_clamp_max: 100.0, i_clamp_min: -100.0, antiwindup: false}
diff --git a/q2d_bringup/config/pid_plus_gravity.yaml b/q2d_bringup/config/pid_plus_gravity.yaml
deleted file mode 100644 (file)
index a0ad17a..0000000
+++ /dev/null
@@ -1,10 +0,0 @@
-pid_plus_gravity_controller:
-        ros__parameters:
-                joints: 
-                        - shoulder_active_joint
-                        - elbow_active_joint
-                shoulder_active_joint: {p: 2310.0, i: 4640.0, d: 0.299, i_clamp_max: 27.94, i_clamp_min: -27.94}
-                elbow_active_joint: {p: 339.0, i: 851.0, d: 0.351, i_clamp_max: 13.62, i_clamp_min: -13.62}
-                gravity: {x: 0.0, y: 0.0, z: -9.8}
-                chain: {root: "origin_link", tip: "tool_link"}
-                priority: 99
index 046bfbe..9a8977b 100644 (file)
@@ -1,7 +1,7 @@
 <!--******************************************************************************
                           Quanser 2DSFJE Bringup
-                       Bypass controller Launch File
-          Copyright (C) 2018, 2021 Walter Fetter Lages <w.fetter@ieee.org>
+                        Bypass Controller Launch File
+          Copyright (C) 2018..2024 Walter Fetter Lages <w.fetter@ieee.org>
 
         This program is free software: you can redistribute it and/or modify
         it under the terms of the GNU General Public License as published by
 
 <launch>
        <arg name="config" default="$(find-pkg-share q2d_bringup)/config/bypass.yaml"/>
-       
-       <node name="shoulder_controller_spawner" pkg="controller_manager" exec="spawner"
-               args="-t forward_command_controller/ForwardCommandController -p $(var config) shoulder_controller"/>
 
-       <node name="elbow_controller_spawner" pkg="controller_manager" exec="spawner"
-               args="-t forward_command_controller/ForwardCommandController -p $(var config) elbow_controller"/>
-               
+       <node name="bypass_controller_spawner" pkg="controller_manager" exec="spawner"
+               args="-p $(var config) bypass_controller"/>
+
        <node name="joint_state_broadcaster_spawner" pkg="controller_manager" exec="spawner"
-               args="-t joint_state_broadcaster/JointStateBroadcaster joint_state_broadcaster"/>
+               args="-p $(find-pkg-share q2d_bringup)/config/joint_state_broadcaster.yaml joint_state_broadcaster"/>
 </launch>
index 8730b23..1056715 100644 (file)
@@ -1,7 +1,7 @@
 <!--******************************************************************************
                           Quanser 2DSFJE Bringup
                    Computed Torque  Controller Launch File
-          Copyright (C) 2021 Walter Fetter Lages <w.fetter@ieee.org>
+          Copyright (C) 2021..2024 Walter Fetter Lages <w.fetter@ieee.org>
 
         This program is free software: you can redistribute it and/or modify
         it under the terms of the GNU General Public License as published by
@@ -23,8 +23,8 @@
        <arg name="config" default="$(find-pkg-share q2d_bringup)/config/computed_torque.yaml"/>
        
        <node name="computed_torque_controller_spawner" pkg="controller_manager" exec="spawner"
-               args="-t effort_controllers/ComputedTorqueController -p $(var config) computed_torque_controller"/>
+               args="-p $(var config) computed_torque_controller"/>
                
        <node name="joint_state_broadcaster_spawner" pkg="controller_manager" exec="spawner"
-               args="-t joint_state_broadcaster/JointStateBroadcaster joint_state_broadcaster"/>
+               args="-p $(find-pkg-share q2d_bringup)/config/joint_state_broadcaster.yaml joint_state_broadcaster"/>
 </launch>
index f685019..ce4ce74 100644 (file)
@@ -1,7 +1,7 @@
 <!--******************************************************************************
                           Quanser 2DSFJE Bringup
-                            Gazebo Launch File
-          Copyright (C) 2018, 2021 Walter Fetter Lages <w.fetter@ieee.org>
+                          Gazebo Sim Launch File
+          Copyright (C) 2018..2024 Walter Fetter Lages <w.fetter@ieee.org>
 
         This program is free software: you can redistribute it and/or modify
         it under the terms of the GNU General Public License as published by
 *******************************************************************************-->
 
 <launch>
-       <arg name="pause" default="true"/>
+       <arg name="pause" default="false"/>
        <arg name="gui" default="true"/>
        <arg name="use_sim_time" default="true"/>
-       <arg name="ignition" default="false"/>
 
        <arg name="controller" default="pid"/>
        <arg name="config" default="$(find-pkg-share q2d_bringup)/config/$(var controller).yaml"/>
 
-       <include unless="$(var ignition)" file="$(find-pkg-share q2d_description)/launch/gazebo.launch.xml" >
+       <include file="$(find-pkg-share q2d_description)/launch/gazebo.launch.xml" >
                <arg name="pause" value="$(var pause)"/>
                <arg name="gui" value="$(var gui)"/>
                <arg name="use_sim_time" value="$(var use_sim_time)"/>
        </include>
        
-       <include if="$(var ignition)" file="$(find-pkg-share q2d_description)/launch/ignition.launch.xml" >
-               <arg name="pause" value="$(var pause)"/>
-               <arg name="gui" value="$(var gui)"/>
-               <arg name="use_sim_time" value="$(var use_sim_time)"/>
-       </include>
-
        <include file="$(find-pkg-share q2d_bringup)/launch/$(var controller).launch.xml" >
                <arg name="config" value="$(var config)"/>
                <arg name="use_sim_time" value="$(var use_sim_time)"/>
diff --git a/q2d_bringup/launch/group_bypass.launch.xml b/q2d_bringup/launch/group_bypass.launch.xml
deleted file mode 100644 (file)
index 6683992..0000000
+++ /dev/null
@@ -1,30 +0,0 @@
-<!--******************************************************************************
-                          Quanser 2DSFJE Bringup
-                    Group Bypass Controller Launch File
-          Copyright (C) 2018, 2021 Walter Fetter Lages <w.fetter@ieee.org>
-
-        This program is free software: you can redistribute it and/or modify
-        it under the terms of the GNU General Public License as published by
-        the Free Software Foundation, either version 3 of the License, or
-        (at your option) any later version.
-
-        This program is distributed in the hope that it will be useful, but
-        WITHOUT ANY WARRANTY; without even the implied warranty of
-        MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
-        Geneal Public License for more details.
-
-        You should have received a copy of the GNU General Public License
-        along with this program.  If not, see
-        <http://www.gnu.org/licenses/>.
-        
-*******************************************************************************-->
-
-<launch>
-       <arg name="config" default="$(find-pkg-share q2d_bringup)/config/group_bypass.yaml"/>
-
-       <node name="group_controller_spawner" pkg="controller_manager" exec="spawner"
-               args="-t effort_controllers/JointGroupEffortController -p $(var config) group_bypass"/>
-
-       <node name="joint_state_broadcaster_spawner" pkg="controller_manager" exec="spawner"
-               args="-t joint_state_broadcaster/JointStateBroadcaster joint_state_broadcaster"/>
-</launch>
diff --git a/q2d_bringup/launch/group_pid.launch.xml b/q2d_bringup/launch/group_pid.launch.xml
deleted file mode 100644 (file)
index 74bfa6a..0000000
+++ /dev/null
@@ -1,30 +0,0 @@
-<!--******************************************************************************
-                          Quanser 2DSFJE Bringup
-                         PID Controller Launch File
-          Copyright (C) 2018, 2021 Walter Fetter Lages <w.fetter@ieee.org>
-
-        This program is free software: you can redistribute it and/or modify
-        it under the terms of the GNU General Public License as published by
-        the Free Software Foundation, either version 3 of the License, or
-        (at your option) any later version.
-
-        This program is distributed in the hope that it will be useful, but
-        WITHOUT ANY WARRANTY; without even the implied warranty of
-        MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
-        Geneal Public License for more details.
-
-        You should have received a copy of the GNU General Public License
-        along with this program.  If not, see
-        <http://www.gnu.org/licenses/>.
-        
-*******************************************************************************-->
-
-<launch>
-       <arg name="config" default="$(find-pkg-share q2d_bringup)/config/group_pid.yaml"/>
-       
-       <node name="group_controller_spawner" pkg="controller_manager" exec="spawner"
-               args="-t effort_controllers/JointGroupPositionController -p $(var config) group_controller"/>
-               
-       <node name="joint_state_broadcaster_spawner" pkg="controller_manager" exec="spawner"
-               args="-t joint_state_broadcaster/JointStateBroadcaster joint_state_broadcaster"/>
-</launch>
index 9eccbd7..26d4dd8 100644 (file)
@@ -22,7 +22,7 @@
 <launch>
        <arg name="gui" default="true"/>
 
-       <arg name="controller" default="group_bypass"/>
+       <arg name="controller" default="bypass"/>
        <arg name="config" default="$(find-pkg-share q2d_bringup)/config/$(var controller).yaml"/>
 
        <include file="$(find-pkg-share q2d_hardware)/launch/controller_manager.launch.xml"/>
                <arg name="use_sim_time" value="false"/>
        </include-->
 
-       <node name="group_controller_spawner" pkg="controller_manager" exec="spawner"
-               args="-t effort_controllers/JointGroupEffortController $(var controller)"/>
+       <node name="bypass_controller_spawner" pkg="controller_manager" exec="spawner"
+               args="-p $(var config) $(var controller)"/>
 
        <node name="joint_state_broadcaster_spawner" pkg="controller_manager" exec="spawner"
-               args="-t joint_state_broadcaster/JointStateBroadcaster joint_state_broadcaster"/>
+               args="-p $(find-pkg-share q2d_bringup)/config/joint_state_broadcaster.yaml joint_state_broadcaster"/>
                
        <include if="$(var gui)" file="$(find-pkg-share q2d_description)/launch/display.launch.xml">
                <arg name="gui" value="false"/>
index 98e279f..ba31b9d 100644 (file)
@@ -1,7 +1,7 @@
 <!--******************************************************************************
                           Quanser 2DSFJE Bringup
                         PID Controller Launch File
-          Copyright (C) 2018, 2021 Walter Fetter Lages <w.fetter@ieee.org>
+          Copyright (C) 2023..2024 Walter Fetter Lages <w.fetter@ieee.org>
 
         This program is free software: you can redistribute it and/or modify
         it under the terms of the GNU General Public License as published by
 
 <launch>
        <arg name="config" default="$(find-pkg-share q2d_bringup)/config/pid.yaml"/>
-
-       <node name="shoulder_controller_spawner" pkg="controller_manager" exec="spawner"
-               args="-t effort_controllers/JointPositionController -p $(var config) shoulder_controller"/>
-
-       <node name="elbow_controller_spawner" pkg="controller_manager" exec="spawner"
-               args="-t effort_controllers/JointPositionController -p $(var config) elbow_controller"/>
+       
+       <node name="pid_controller_spawner" pkg="controller_manager" exec="spawner"
+               args="-p $(var config) pid_controller"/>
                
        <node name="joint_state_broadcaster_spawner" pkg="controller_manager" exec="spawner"
-               args="-t joint_state_broadcaster/JointStateBroadcaster joint_state_broadcaster"/>
+               args="-p $(find-pkg-share q2d_bringup)/config/joint_state_broadcaster.yaml joint_state_broadcaster"/>
 </launch>
diff --git a/q2d_bringup/launch/pid_plus_gravity.launch.xml b/q2d_bringup/launch/pid_plus_gravity.launch.xml
deleted file mode 100644 (file)
index 0546b12..0000000
+++ /dev/null
@@ -1,30 +0,0 @@
-<!--******************************************************************************
-                          Quanser 2DSFJE Bringup
-                     PID+gravity Controller Launch File
-          Copyright (C) 2021 Walter Fetter Lages <w.fetter@ieee.org>
-
-        This program is free software: you can redistribute it and/or modify
-        it under the terms of the GNU General Public License as published by
-        the Free Software Foundation, either version 3 of the License, or
-        (at your option) any later version.
-
-        This program is distributed in the hope that it will be useful, but
-        WITHOUT ANY WARRANTY; without even the implied warranty of
-        MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
-        Geneal Public License for more details.
-
-        You should have received a copy of the GNU General Public License
-        along with this program.  If not, see
-        <http://www.gnu.org/licenses/>.
-        
-*******************************************************************************-->
-
-<launch>
-       <arg name="config" default="$(find-pkg-share q2d_bringup)/config/pid_plus_gravity.yaml"/>
-       
-       <node name="pid_plus_gravity_controller_spawner" pkg="controller_manager" exec="spawner"
-               args="-t effort_controllers/PidPlusGravityController -p $(var config) pid_plus_gravity_controller"/>
-               
-       <node name="joint_state_broadcaster_spawner" pkg="controller_manager" exec="spawner"
-               args="-t joint_state_broadcaster/JointStateBroadcaster joint_state_broadcaster"/>
-</launch>
index 38c2178..d1db84c 100755 (executable)
@@ -1,29 +1,31 @@
 #!/usr/bin/python3
 
 import sys
+import array
 
 import rclpy
 from rclpy.node import Node
-from std_msgs.msg import Float64
+from control_msgs.msg import MultiDOFCommand
 
 class SquarePublisher(Node):
 
        def __init__(self):
                super().__init__('square_publisher')
-               self.publisher_=self.create_publisher(Float64,sys.argv[1],1)
-               timer_period=float(sys.argv[4])
+               self.publisher_=self.create_publisher(MultiDOFCommand,"/pid_controller/reference",1)
+               timer_period=float(sys.argv[5])
                self.timer=self.create_timer(timer_period,self.timer_callback)
                self.turn=True;
 
        def timer_callback(self):
-               ref=Float64()
-               ref.data=float(sys.argv[2] if self.turn else sys.argv[3])
+               ref=MultiDOFCommand()
+               ref.dof_names=["shoulder_active_joint", "elbow_active_joint"]
+               ref.values=[float(sys.argv[1] if self.turn else sys.argv[2]), float(sys.argv[3] if self.turn else sys.argv[4])]
                self.turn=not self.turn
                self.publisher_.publish(ref)
         
 def main(args=None):
        if len(sys.argv) < 5:
-               print('square.py topic min max period')
+               print('ijc_square.py shoulder_min shoulder_max elbow_min elbow_max period')
                exit()
        
        rclpy.init(args=args)
index 26f69df..c6f573b 100755 (executable)
@@ -1,4 +1,8 @@
 #!/bin/bash
 
-ros2 topic pub /shoulder_controller/command std_msgs/msg/Float64 "{data: $1}" -1 &
-ros2 topic pub /elbow_controller/command std_msgs/msg/Float64 "{data: $2}" -1
+if [ "$#" -ne 2 ]; then
+        echo "Usage: $0 <shoulder_angle elbow_angle>>"
+        exit -1;
+fi;
+
+ros2 topic pub /pid_controller/reference control_msgs/msg/MultiDOFCommand "{dof_names: ["shoulder_active_joint", "elbow_active_joint"], values: [$1, $2]}" -1
similarity index 54%
rename from q2d_bringup/scripts/group_torque_step.sh
rename to q2d_bringup/scripts/torque_step.sh
index 5b61a7e..b822ff0 100755 (executable)
@@ -5,4 +5,4 @@ if [ "$#" -ne 2 ]; then
         exit -1;
 fi;
 
-ros2 topic pub /group_controller/commands std_msgs/msg/Float64MultiArray "{data: [$1, $2] }" -1
+ros2 topic pub /bypass_controller/commands std_msgs/msg/Float64MultiArray "{data: [$1, $2] }" -1
index 8bc8c3c..cd6ed07 100644 (file)
@@ -26,6 +26,4 @@ if(BUILD_TESTING)
   ament_lint_auto_find_test_dependencies()
 endif()
 
-ament_environment_hooks("${CMAKE_CURRENT_SOURCE_DIR}/env-hooks/${PROJECT_NAME}.dsv.in")
-
 ament_package()
diff --git a/q2d_description/config/gz_bridge.yaml b/q2d_description/config/gz_bridge.yaml
new file mode 100644 (file)
index 0000000..2154629
--- /dev/null
@@ -0,0 +1,10 @@
+- ros_topic_name: "/clock"
+  gz_topic_name: "/clock"
+  ros_type_name: "rosgraph_msgs/msg/Clock"
+  gz_type_name: "ignition.msgs.Clock"
+#  subscriber_queue: 5       # Default 10
+#  publisher_queue: 6        # Default 10
+#  lazy: true                # Default "false"
+  direction: GZ_TO_ROS      # Default "BIDIRECTIONAL" - Bridge both directions
+                            # "GZ_TO_ROS" - Bridge Ignition topic to ROS
+                            # "ROS_TO_GZ" - Bridge ROS topic to Ignition
diff --git a/q2d_description/env-hooks/q2d_description.dsv.in b/q2d_description/env-hooks/q2d_description.dsv.in
deleted file mode 100644 (file)
index 30a6001..0000000
+++ /dev/null
@@ -1,3 +0,0 @@
-prepend-non-duplicate;IGN_GAZEBO_RESOURCE_PATH;share
-
-set-if-unset;MESA_GL_VERSION_OVERRIDE;3.3
index d3745f6..b5ac5a0 100644 (file)
@@ -48,7 +48,7 @@ def generate_launch_description():
                         package='tf2_ros',
                         executable='static_transform_publisher',
                         name='q2d_origin_publisher',
-                        arguments=["--frame-id", "map","--child-frame-id","origin_link"]),
+                        arguments=["--frame-id", "map","--child-frame-id","World"]),
                 Node(
                         package='joint_state_publisher_gui',
                         executable='joint_state_publisher_gui',
index 807304d..5848fc0 100644 (file)
@@ -21,7 +21,7 @@
 
 <launch>
        <arg name="gui" default="false"/>
-       <node pkg="tf2_ros" exec="static_transform_publisher" name="q2d_origin_publisher" args="--frame-id map --child-frame-id origin_link"/>
+       <node pkg="tf2_ros" exec="static_transform_publisher" name="q2d_origin_publisher" args="--frame-id map --child-frame-id World"/>
        <node if="$(var gui)" name="joint_state_publisher" pkg="joint_state_publisher_gui" exec="joint_state_publisher_gui"/>
        <include file="$(find-pkg-share q2d_description)/launch/q2d.launch.xml"/>
        <node name="rviz" pkg="rviz2" exec="rviz2" args="-d $(find-pkg-share q2d_description)/config/display.rviz"/>
index 356ab65..0260838 100644 (file)
@@ -20,7 +20,7 @@
 *******************************************************************************-->
 
 <launch>
-       <arg name="pause" default="true"/>
+       <arg name="pause" default="false"/>
        <arg name="gui" default="true"/>
        <arg name="use_sim_time" default="true"/>
 
@@ -41,7 +41,8 @@
 
        <node name="q2d_spawner" pkg="ros_gz_sim" exec="create" args="-topic robot_description -name q2d"/>
 
-       <node name="clock_bridge" pkg="ros_gz_bridge" exec="parameter_bridge" args="/clock@rosgraph_msgs/msg/Clock[ignition.msgs.Clock">
+       <node name="ros_gz_bridge" pkg="ros_gz_bridge" exec="parameter_bridge">
+               <param name="config_file" value="$(find-pkg-share q2d_description)/config/gz_bridge.yaml"/>
                <param name="use_sim_time" value="$(var use_sim_time)"/>
        </node>
 </launch>
index b55f348..abe7be3 100644 (file)
@@ -4,8 +4,15 @@
        <xacro:arg name="hardware" default="gazebo"/>
        <xacro:property name="hardware" value="$(arg hardware)"/>
 
+       <link name="World"/>
+
        <link name="origin_link"/>
 
+       <joint name="world_joint" type="fixed">
+               <parent link="World"/>
+               <child link="origin_link"/>
+       </joint>
+
        <link name="base_link">
                <inertial>
                        <origin xyz="0.074571214 -0.00008502114 0.039600060500000"/>
                <origin xyz="0.267 0 0"/>
        </joint>
 
-       <transmission name="shoulder_active_transmission">
-               <type>transmission_interface/SimpleTransmission</type>
-               <joint name="shoulder_active_joint">
-                       <hardwareInterface>hardware_interface/EffortJointInterface</hardwareInterface>
-               </joint>
-               <actuator name="shoulder_motor">
-                       <mechanicalReduction>1</mechanicalReduction>
-               </actuator>
-       </transmission>
-
-       <transmission name="elbow_active_transmission">
-               <type>transmission_interface/SimpleTransmission</type>
-               <joint name="elbow_active_joint">
-                       <hardwareInterface>hardware_interface/EffortJointInterface</hardwareInterface>
-               </joint>
-               <actuator name="elbow_motor">
-                       <mechanicalReduction>1</mechanicalReduction>
-               </actuator>
-       </transmission>
-
        <gazebo reference="base_link">
                <visual>
                        <material>
 
        <ros2_control name="Q2dSystem" type="system">
                <xacro:if value="${hardware == 'gazebo'}">
-                       <!-- Gazebo Sim-->
                        <hardware>
-                               <plugin>ign_ros2_control/IgnitionSystem</plugin>
+                               <plugin>gz_ros2_control/GazeboSimSystem</plugin>
                        </hardware>
                </xacro:if>
                <xacro:if value="${hardware == 'real_robot'}">
-                       <!-- Actual Hardware -->
                        <hardware>
                                <plugin>q2d_hardware/Q2dSystemHardware</plugin>
                        </hardware>
        </ros2_control>
 
        <gazebo>
-               <xacro:if value="${hardware == 'gazebo'}">
-                       <!-- Gazebo Ignition -->
-                       <plugin filename="libign_ros2_control-system.so" name="ign_ros2_control::IgnitionROS2ControlPlugin">
-                               <robot_param>robot_description</robot_param>
-                               <robot_param_node>robot_state_publisher</robot_param_node>
-                               <parameters>$(find q2d_description)/config/controller_manager.yaml</parameters>
-                       </plugin>
-               </xacro:if>
+               <plugin filename="gz_ros2_control-system" name="gz_ros2_control::GazeboSimROS2ControlPlugin">
+                       <parameters>$(find q2d_description)/config/controller_manager.yaml</parameters>
+               </plugin>
        </gazebo>
 
 </robot>
index cc3cdfa..3857a75 100644 (file)
@@ -1,7 +1,7 @@
 <!--
   q2d_teleop: A ROS 2 package node to teloperate the Quanser 2DSFJE robot.
   
-  Copyright (c) 2018..2023 Walter Fetter Lages <w.fetter@ieee.org>
+  Copyright (c) 2018..2024 Walter Fetter Lages <w.fetter@ieee.org>
 
     This program is free software; you can redistribute it and/or modify
     it under the terms of the GNU General Public License as published by
 -->
 
 <launch>
-       <arg name="ignition" default="false"/>
-       
        <include file="$(find-pkg-share q2d_bringup)/launch/gazebo.launch.xml">
                <arg name="pause" value="false"/>
-               <arg name="ignition" value="$(var ignition)"/>
        </include>
 
        <node name="q2d_teleop_tablet" pkg="q2d_teleop" exec="q2d_teleop_tablet"/>