0
$\begingroup$

Rosanswers logo

Hello, first of all, for a bit of context : I'm using Ubuntu 20.04 with ROS Foxy and Gazebo 11 (I think) I'm still learning ROS so I might be inacurate but I'll try my best!

I'm building a simulation for a real robot. This real robot already implement an extended Kalman filter with the robot localization package. This EKF takes as an input an imu and odometry from motor controllers. This odometry consists of the linear X velocity and the angular Z velocity.

The EKF produces the odom ->base_link /tf and i want the simulation to be as similar as possible to the actual robot.

My question is:

Is there a way to make the differential_drive_controller plugin publish data on the same format and not x,y and z position as it is currently doing :

here is my code for the diff_drive_controller in my robot_description :

<gazebo>
<plugin name='diff_drive' filename='libgazebo_ros_diff_drive.so'>
<ros>
<remapping>odom:=motor_controller/odom</remapping>
</ros>

<!-- wheels -->
<left_joint>left_wheel_joint</left_joint>
<right_joint>right_wheel_joint</right_joint>

<!-- kinematics -->
<wheel_separation>0.609</wheel_separation>
<wheel_diameter>0.625</wheel_diameter>

<!-- limits -->
<max_wheel_torque>20</max_wheel_torque>
<max_wheel_acceleration>1.0</max_wheel_acceleration>

<!-- output -->
<publish_odom>true</publish_odom>
<publish_odom_tf>false</publish_odom_tf>
<publish_wheel_tf>true</publish_wheel_tf>

<odometry_frame>odom</odometry_frame>
<robot_base_frame>base_link</robot_base_frame>
</plugin>
</gazebo>

Should i write another node that take the output of diff_drive and transform it correctly ? is there another plugin that could work ? Any help would be greatly appreciated !


Originally posted by Bastian2909 on ROS Answers with karma: 68 on 2022-05-23

Post score: 0


Original comments

Comment by Joe28965 on 2022-05-24:
What is the 'same format'. What message does your robot publish? The gazebo_ros plugin publishes nav_msgs/msg/Odometrywhich is the default message to publish odometry in. Which makes me question what you're using on the actual robot.

If that robot is publishing in another message type, I feel like that's a problem of the robot. Of course I don't know if you could update that part to publish using nav_msgs/msg/Odometry. However, I don't think your robot is following the standard for odometry messages.

$\endgroup$

1 Answer 1

0
$\begingroup$

Rosanswers logo

Actually, i didn't needed to write a pipeline or anything, but just change my ekf node config file :

odom0: /odom
    odom0_config: [false, false, false,
                  false, false, false,
                  true,  true,  true,
                  false, false, true,
                  false, false, false]

now my ekf takes only input from angular Z velocity and linear X velocity


Originally posted by Bastian2909 with karma: 68 on 2022-05-25

This answer was ACCEPTED on the original site

Post score: 1

$\endgroup$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.