Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Odom topic have no output #1

Closed
HazemAbidi opened this issue Mar 22, 2021 · 9 comments
Closed

Odom topic have no output #1

HazemAbidi opened this issue Mar 22, 2021 · 9 comments

Comments

@HazemAbidi
Copy link

HazemAbidi commented Mar 22, 2021

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:
<gazebo> <plugin filename="libgazebo_ros_joint_state_publisher.so" name="joint_states">
`

  <joint_name>chassis_roue_motrice_droite</joint_name>
  <joint_name>chassis_roue_motrice_gauche</joint_name>
</plugin>

<plugin filename="libgazebo_ros_diff_drive.so" name="differential_drive_controller">
  <ros>
    <!-- Set namespace -->
    <namespace></namespace>
    <!-- Remap default topics -->
    <remapping>/cmd_vel:=cmd_vel</remapping>
    <!--remapping>/odom:=odom</remapping-->
  </ros>
  <!-- Replace camelCase elements with camel_case ones -->
  <alwaysOn>true</alwaysOn>
  <legacyMode>false</legacyMode>
  <update_rate>100</update_rate>
  <left_joint>chassis_roue_motrice_gauche</left_joint>
  <right_joint>chassis_roue_motrice_droite</right_joint>
  <wheel_separation>0.6855600</wheel_separation>
  <wheel_diameter>0.2032000</wheel_diameter>
  <odometry_frame>odom</odometry_frame>
  <!--publishTf>1</publishTf>
  <rosDebugLevel>na</rosDebugLevel-->
  <robot_base_frame>base_link</robot_base_frame>

  <!-- wheelTorque and wheelAcceleration now have max_ prefix -->
  <max_wheel_torque>20</max_wheel_torque>
  <!--max_acceleration>1.0</max_acceleration-->
  <publish_odom>false</publish_odom>
  <publish_odom_tf>false</publish_odom_tf>
  <publish_wheel_tf>true</publish_wheel_tf>
  <!--publish_tf>1</publish_tf-->
  <odometry_source>world</odometry_source>
  <!--publishWheelJointState>false</publishWheelJointState-->
</plugin>

`
After spawning the robot I just run the laser_scan_matcher executable file.
Any idea please.
I thank you in advance

@AlexKaravaev
Copy link
Owner

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

@HazemAbidi
Copy link
Author

HazemAbidi commented Mar 23, 2021

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
Copy link
Owner

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
Copy link
Author

HazemAbidi commented Mar 23, 2021

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
Copy link
Owner

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
Copy link
Author

HazemAbidi commented Mar 23, 2021

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
Copy link
Owner

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
Copy link
Author

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
Copy link
Owner

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants