DiffDriveController in Gazebo Ros control
Hi! I set up a sim via rviz & gazebo firstly using gazebo diff drive plug in. then I noticed some limits using this model and I attempted to switch to gazebo_ros_control diff_drive_controller. the robot spawns and visualizes in gazebo but when in rviz I try to command via joystick or setting a 2d goal nothing happens.
What is wrong? Am i missing something? Are the two libraries substitutes or do they complement each other?
Launch file
<?xml version="1.0" encoding="UTF-8"?>
<launch>
<param name="/use_sim_time" value="true" />
<param name="robot_description" command="$(find xacro)/xacro --inorder $(find nav-sim)/urdf/gbot.urdf.xacro" />
<node pkg="rviz" type="rviz" name="rviz" output="screen"/>
<node pkg="robot_state_publisher" name="robot_state_publisher" type="robot_state_publisher" />
<node pkg="joint_state_publisher" name="joint_state_publisher" type="joint_state_publisher" />
<arg name="x" default="0"/>
<arg name="y" default="0"/>
<arg name="z" default="0"/>
<!-- <include file="$(find nav-sim)/launch/gbot_control_teleop.launch" />-->
<include file="$(find gazebo_ros)/launch/empty_world.launch">
<arg name="world_name" value="$(find nav-sim)/launch/complicated_world_tagged" />
<arg name="debug" value="false" />
<arg name="gui" value="true" />
<arg name="paused" value="false"/>
<arg name="use_sim_time" value="true"/>
<arg name="headless" value="false"/>
<arg name="verbose" value="true"/>
</include>
<node name="spawn_robot_urdf" pkg="gazebo_ros" type="spawn_model" output="screen"
args="-urdf -param robot_description -model gbot.urdf.xacro -x $(arg x) -y $(arg y) -z $(arg z)" >
</node>
<rosparam file="$(find nav-sim)/config/gconfig.yaml" command="load" />
<node name="spawner" pkg="controller_manager" type="spawner"
respawn="false" output="screen" args= "mobile_base_controller" />
</launch>
Plug in
<?xml version="1.0"?>
<robot>
<gazebo reference="base_link">
<plugin name="gazebo_ros_control" filename="libgazebo_ros_control.so">
<robotSimType>gazebo_ros_control/DefaultRobotHWSim</robotSimType>
</plugin>
</gazebo>
<!-- <gazebo reference="base_link">-->
<!-- <plugin name="differential_drive_controller" filename="libgazebo_ros_diff_drive.so">-->
<!-- <alwaysOn>true</alwaysOn>-->
<!-- <legacyMode>false</legacyMode>-->
<!-- <updateRate>20</updateRate>-->
<!-- <leftJoint>left_wheel_joint</leftJoint>-->
<!-- <rightJoint>right_wheel_joint</rightJoint>-->
<!-- <wheelSeparation>${wheel_separation}</wheelSeparation>-->
<!-- <wheelDiameter>${wheel_radius * 2}</wheelDiameter>-->
<!-- <torque>20</torque>-->
<!-- <commandTopic>/twist_mux/cmd_vel</commandTopic>-->
<!-- <odometryTopic>/odom_in</odometryTopic>-->
<!-- <odometryFrame>odom</odometryFrame>-->
<!-- <robotBaseFrame>base_link</robotBaseFrame>-->
<!-- <publishWheelTF>false</publishWheelTF>-->
<!-- <publishWheelJointState>false</publishWheelJointState>-->
<!-- <odometrySource>world</odometrySource> <!– 'encoder' instead of 'world' is also possible –>-->
<!-- <publishTf>1</publishTf>-->
<!-- </plugin>-->
<!-- </gazebo>-->
<!-- hokuyo -->
<gazebo reference="laser_frame_HF">
<sensor type="ray" name="head_hokuyo_sensor_front">
<pose>0 0 0 0 0 0</pose>
<visualize>true</visualize>
<update_rate>40</update_rate>
<ray>
<scan>
<horizontal>
<samples>1800</samples>
<resolution>0.2</resolution>
<min_angle>-3.14</min_angle>
<max_angle>3.14</max_angle>
</horizontal>
</scan>
<range>
<min>0.40</min>
<max>10.0</max>
<resolution>0.01</resolution>
</range>
<noise>
<type>gaussian</type>
<!-- Noise parameters based on published spec for Hokuyo laser
achieving "+-30mm" accuracy at range < 10m. A mean of 0.0m and
stddev of 0.01m will put 99.7% of samples within 0.03m of the ...