<?xml version="1.0"?>
<robot xmlns:xacro="http://www.ros.org/wiki/xacro">
    <xacro:macro name="ros2_controller">
        <ros2_control name="FishBotGazeboSystem" type="system">
            <hardware>
                <plugin>gazebo_ros2_control/GazeboSystem</plugin>
            </hardware>
            
            <!-- 配置所有轮子的控制接口 -->
            <joint name="front_left_wheel_joint">
                <command_interface name="position" />
                <command_interface name="velocity" />
                <command_interface name="effort" />
                <state_interface name="position" />
                <state_interface name="velocity" />
                <state_interface name="effort" />
            </joint>

            <joint name="front_right_wheel_joint">
                <command_interface name="position" />
                <command_interface name="velocity" />
                <command_interface name="effort" />
                <state_interface name="position" />
                <state_interface name="velocity" />
                <state_interface name="effort" />
            </joint>

            <joint name="rear_left_wheel_joint">
                <command_interface name="position" />
                <command_interface name="velocity" />
                <command_interface name="effort" />
                <state_interface name="position" />
                <state_interface name="velocity" />
                <state_interface name="effort" />
            </joint>

            <joint name="rear_right_wheel_joint">
                <command_interface name="position" />
                <command_interface name="velocity" />
                <command_interface name="effort" />
                <state_interface name="position" />
                <state_interface name="velocity" />
                <state_interface name="effort" />
            </joint>
        </ros2_control>
        <gazebo>
            <plugin filename="libgazebo_ros2_control.so" name="gazebo_ros2_control">
                <parameters>$(find agv_pro_gazebo)/config/agv_control.yaml</parameters>
                <ros>
                    <remapping>/omni_drive_controller/cmd_vel:=/cmd_vel</remapping>
                    <remapping>/omni_drive_controller/odom:=/odom</remapping>
                </ros>
            </plugin>
        </gazebo>
    </xacro:macro>
</robot>
