ROS Diferential Plugin - Gmapping

Hi experts

I am facing an issue to adapt Gmapping to Prius urdf model. At first I needed to use the package Point_cloud_to_laser_scan in order to convert the point cloud msg type data to sensor_mgs/laser_scan data. Ok Then now I am trying to couple properly the parameters

 <param name="base_frame" value="footprint"/>
      <param name="odom_frame" value="odom"/>

My robot did not have the footprint link, so I created. It also did not had an odometry in urdf (just used a static transform publisher with coupled with the “fake_localization pkg” to pass the car spot regarding an external odom source (all this was written in the original launch file of Prius).
Than I have removed this external odom and fake_localization pkg from launch file, and added inside the PRIUS urdf the “ROS differential Plugin”. However for my surprise the gmapping cannot read the odometry and when I open Rviz this TF error appears me. Besides that I can see that the plugin adds two “ghosts” wheels in perpedicular orientation instead of be placed where the original ones are. Look, please:


Is there a way to correct this orientation? I have already tried to change the order of add the left and the right wheel, without success unfortunately. However I am not sure if this is the reason of the gmapping does not read the odom value. I have used the rostopic echo /odom and it is workin normally…
What should I do to fit the gmapping node with my odometry.
I have already opened almost all the turtlebot/kobuki description file and summit_xl description file to have a base of how these parameters are taken inside it. And I tried to add some features of them to my prius pkg. However these 2 robots have really huge robot description files, linked with numerous internal description xacros…
Do you hava a hint to me, please?

Hi,

I suppose you have done the ocurses on selfdriving cars .
Navigation with cars, you have to tak into account that the are NOT differential drive robots. Therefore the navigation will suffer form that. Ackerman has to be taken into account.

1 Like

No I did not. I am finishing the last class of navigation course. I am trying to apply the project for summit to a real car. To generate the map. I think the problem is about transform the laser data into the odometry through a TF that I must to generate…I am reading about this in order to fix this issue. Am I in the right way?
In my head I would skip to self-driving car last 2 courses after had finished this summit project applied to a car…or should I not try this?

@duckfrost

I have set everything “correctly” I don’t receive error in Rviz and even in my gmapping node.
the laser conversion is done successfully I suppose because it is showed in Rviz such as in the construct tutorials…

However I cannot understand why the map keeps not being received…

I found a “Pseudo solution” for this case. I don’t know if it is right. I think it is not.
I have used in my gmapping launch file the Transform Static Publisher for left_laser_scan as a child of the base_link.

In this way the map appeared. I don’t know why the TF is not being correctly read from in Prius URDF…
I think what I have done is not right because now the Laser_scan_frame is not located in its real position (child chassis link)…however it worked.

Hi again @duckfrost, @staff I successfully applied the TEB local planner for my modified Prius…however just the planner is calculated… I am facing 3 issues here:

1 - The AMCL is not working properly because it is like have 2 cars in the simulation, one ghost that stays binking in the wrong position, and the AMCL point cloud indicates it is there (but it is not). And the same car flashing in the real position, but the AMCL is not near it.

Maybe the issue is that I mapped the environment and later launche the move_base node wich shrinked the AMCL node with the map_server already done (loaded again over this one in Rviz). It is the same map, however maybe this is causing the 2 ghosts…I am not sure.

2- The TEB calculates 2 planners: 1 planner to go from the ghost wrong position car to the ghost blinking right position frame (or inverse, I am not sure). And also another planner for the spot I indicated using the icon NAV_GOAL in Rviz. It displays in the same time these 2 trajectories in Rviz and the car becomes stuck. In the image is possible to see 2 purples lines linking the false-car position to the goal…and another linking the right_car frame position to the false_car position frame…

3- The car does not move, just the direction obeys the planner direction. If the planner indicates left direction the car turns the wheels to left…and right if the planner calculates right. However it does not throtle…I don’t know why (just using the keyboard command…not autonomously).
I thought that this was an issue of occupied cells at first.Then later I realized that was not, because I used a Costmap Conversion params to the move_base node ( I had previously a information that the cells were being considered busy because I did not have a costmap coversion)…

I verified the prius/cmd_vel topic and nothing is published on it…I also tried to publish manually on it, but the car did not move. Maybe another topic is responsible to move the car, and I can not recognize, because I tried already to understand the prius_keyboard teleop script but I could not see a topic it publishes…just “throttle” and “turn”, however I am not sure this is a topic.
I have used the script teached in lesson 4 of this module to convert cmd_vel to ackermann msg type. It worked, however it seems that the car does not have this topic in its urdf…


So maybe I should use the ackermann plugin instead of diff drive. But I need using the the diff drive becuase of the odom frame it generates or not?

So I can’t understand why the car does not start accelerating. Maybe be the original modification I did, that I used the diff_drive plugin to add an Odom frame to the car, in order for the gmapping node works properly, considering that this node requires an odom to make the transformation - base_footprint-odom-map…? Or not? I have seen you have written me about the ackermann. I still did not finish the last module from ROS for Autonomous Vehicles. Just finished the TEB modules today. Do you think changing this plugin the things will work, or this exist another issue affecting the car navigation? And more one question the Ackermann plugin is teached in the ROS 101 for autonomous vehicles? The next module?

Well I have taken a look in how to use the Ackermann drive plugin. But I am not sure how to use it…could you provide a tutorial or video how to do that? There are different ways to be used according to internet https://github.com/aurofable/ros/blob/master/urdfPractice/car.urdf and https://github.com/ros-simulation/gazebo_ros_pkgs/pull/947 …

I am little confused. I think I need to remove the diff_drive plugin and add the ackermman plugin. However it seems that prius has already its plugin: “The Hybrid drive…”. So I am confused how to make the car moves using the right plugin…what should I try at first?

Thanks in advance