AlexKaravaev / ros2_laser_scan_matcher

Laser scan matcher ported to ROS2
51 stars 42 forks source link

Odom topic have no output #1

Closed HazemAbidi closed 3 years ago

HazemAbidi commented 3 years ago

Hello, I'm working on a project in Ros2 foxy and I want to use the laser scan matcher to get the odometry from it. I changed publish_odom param to "odom" and publish_tf to true and I still don't have an output when I run ros2 topic echo /odom . Also the tf tree has no odom frame on it. My diff drive plugin is the following: `

` ` chassis_roue_motrice_droite chassis_roue_motrice_gauche /cmd_vel:=cmd_vel true false 100 chassis_roue_motrice_gauche chassis_roue_motrice_droite 0.6855600 0.2032000 odom base_link 20 false false true world ` After spawning the robot I just run the laser_scan_matcher executable file. Any idea please. I thank you in advance
AlexKaravaev commented 3 years ago

Have you checked rqt_graph, to check whether laser_scan_matcher subscribed to correct topic of laser scan?

HazemAbidi commented 3 years ago

Yes I did that it appears that the laser_scan_matcher subscribes to the /scan topic but it didn't subscribe to the /tf topic. Also, it publishes /tf and /odom topics. And there is no odom frame in the tf tree.

AlexKaravaev commented 3 years ago

I don't understand, node is publishing /tf and /odom topics or not?

Also, it publishes /tf and /odom topics.

I have checked now, it should publish both, if parameters are set correctly.

Can you please check following things: 1) Parameters are actually set. Better to do that with ros2 param get ... 2) Node is actually launched and running

Also, it would be helpful if you post console output here when you launch the node.

HazemAbidi commented 3 years ago

Hello, Alright this is my rqt graph : rqt_graph_lsm So these are the params that I've changed: add_parameter("publish_odom", rclcpp::ParameterValue(std::string("odom")), "If publish odometry from laser_scan. Empty if not, otherwise name of the topic"); add_parameter("publish_tf", rclcpp::ParameterValue(true), " If publish tf odom->base_link"); And finally the console: lsm_console for the params : lsm_get_param

AlexKaravaev commented 3 years ago

Thank you for the output, all looks fine for me. Due to the fact, that when you echo topic it says nothing, it maybe unmatched QoS settings. If the topic is not published it should say WARNING: topic [/odom] does not appear to be published yet.

Can you double check in rviz, that odom is not published?

HazemAbidi commented 3 years ago

Thank you for your quick response. I checked Rviz as I said I haven't found an odometry frame. I changed the durability and reliability policies of the Odom topic and nothing happened. (tried transient local durability and best-effort reliability) Isn't meant that laser scan matcher node to subscribe to /tf topic? Because it doesn't appear that it is subscribing to it in the rqt_graph. Correct me if I'm wrong please.

AlexKaravaev commented 3 years ago

Do you have any MWE? I've run all the latest files in simulation today and all worked fine.

Also, you can double check that data arrives to the /scan topic. If you are using not the latest gazebo_ros_pkgs , it does use QoS by default, that will be unmatched by laser scanner (see this PR)

If there is no data on the /scan topic, please update gazebo_ros_pkgs to latest version, it should fix all the issues. Otherwise, you can send your package here and I will see what's the issue, because on my machine all is working.

HazemAbidi commented 3 years ago

Hey again, I checked the QoS of both publisher and subscriber of /scan topic. QoS As you can see the QoS is not compatible, gazebo_head_hoyoku is giving a best effort reliability however laser_scan_matcher wats a reliable reliability This is the version of gazebo ros pkgs that I have and it says that it is the latest version gazebo_ros_pkgs

AlexKaravaev commented 3 years ago

I suggest you to build them from source, that way you guaranteed to get the latest version, but this issue is out of scope of this project, so I will close it