How to set up diff_drive_controller?
I want to properly set the odometry for my 2W robot and decided to use diffdrivecontroller for that. I got a bit confused by reading the wiki page. It says that the package subscribes to cmd_vel and publishes odometry based on that. Does it mean that I do not need any encoders to send?
Also, a quick question regarding the wheels. The package also asks for the wheel joints and I have descrbied them in my xacro file:
<joint name="wheel_left_joint" type="continuous">
<parent link="base_link"/>
<child link="wheel_left_link"/>
<origin xyz="0.0 0.08 0.023" rpy="-1.57 0 0"/>
<axis xyz="0 0 1"/>
</joint>
<link name="wheel_left_link">
<visual>
<origin xyz="0 0 0" rpy="1.57 0 0"/>
<geometry>
<mesh filename="package://turtlebot3_description/meshes/wheels/left_tire.stl" scale="0.001 0.001 0.001"/>
</geometry>
<material name="dark"/>
</visual>
And if I use gazebo:
<gazebo reference="wheel_left_link">
<mu1>0.1</mu1>
<mu2>0.1</mu2>
<kp>500000.0</kp>
<kd>10.0</kd>
<minDepth>0.001</minDepth>
<maxVel>0.1</maxVel>
<fdir1>1 0 0</fdir1>
<material>Gazebo/FlatBlack</material>
</gazebo>
The wheels get their TF but how can I enable TF when I use a real robot? For some reason they are missing.
Asked by stevemartin on 2019-01-13 09:01:20 UTC
Answers
"The package subscribes to cmd_vel and publishes odometry based on that"
From the wiki of diff drive controller:
Odometry is computed from the feedback from the hardware
that means the encoder feedback you have to be providing through the Hardware Interfaces of ROS Control. Not the cmd vel
"How can I enable TF when I use a real robot?"
Using the robot state publisher node. You can add this line to your hardware launch file to use it:
<node name="robot_state_publisher" pkg="robot_state_publisher" type="robot_state_publisher" />
Asked by juanlu on 2019-01-14 03:41:30 UTC
Comments
@juanlu I do have static state publisher and I also tried to use robot_state_publisher but it does not produce tf to the wheels for some reason
Asked by stevemartin on 2019-01-14 14:57:04 UTC
Comments