RVIZ shows "Uninitialized quaternion, assuming identity." when displaying Octomap mapping
Dear community, While visualizing the octomap_mapping in RVIZ, I am getting an error stating "Uninitialized quaternion, assuming identity.
[Image attached], due to which my octomap maps the environment BUT very scattered and un-updated.
I am getting left/right images along with camera information from CoppeliaSim (previously VREP) and later find pointclouds2 using StereoImageproc ROS package. The pointcloud is then subscribed by the octomap_mapping along with /tf data. The /tf frames while visualizing in rviz seems working perfectly. I do not know what am i doing wrong.
Can someone please help me in identifying the issue?
Thank you and regards.
EDIT: So I fixed the problem. Actually, my /tf
transformation was wrong. We need a transformation from sensor's frame (in my case that is the Stereoframe) to the fixed frame (which in my case is the world frame) . My /tf
tree now looks like `/stereoframe->
baseframe->
worldframe`.
Asked by SIU0598 on 2021-06-14 05:01:24 UTC
Answers
It is not really an error per-say, it is just a warning. It looks like the markers that are coming from the octomap server have not initialized the quaternions (where each field is probably 0). So instead, rviz is just assuming they have a zero rotation (a quaternion of [0,0,0,1]), which is probably a fair assumption.
Each Marker message used in the MarkerArray that you are subscribing to has a pose
associated with it.
Looking at the octomap server code publishing the message, they do not set the pose at all. However, the position is set from setting the point in the message it seems.
Funny enough, a pose does get initialized but is never really used anywhere... I would assume someone forget to set the pose for the visualization messages.
I would assume the "Uninitialized quaternion, assuming identity." warning has nothing to do with your octomap performance issues, which it looks like it was a tf
issue based on your edit.
Asked by 404RobotNotFound on 2021-06-23 18:55:56 UTC
Comments
You need to initialized quaternion of marker
add four line under marker = Marker()
marker.pose.orientation.x = 0.0
marker.pose.orientation.y = 0.0
marker.pose.orientation.z = 0.0
marker.pose.orientation.w = 1.0
or
from geometry_msgs.msg import Quaternion
# your code
marker = Marker()
marker.pose.orientation = Quaternion(0.0, 0.0, 0.0, 1.0)
Asked by YuHsiangLo on 2023-04-19 02:14:59 UTC
Comments
I also exactly got same error. My Octomap is also not updating. Have you got any solution? or is there anyone can help?
Asked by arifzaman on 2021-06-15 13:53:20 UTC
No I am still working on it and I have tried multiple methods and different techniques to solve the issue but haven't got any success yet. Will surely update here if got any fix.
Asked by SIU0598 on 2021-06-16 00:41:46 UTC