Quantcast
Channel: ROS Answers: Open Source Q&A Forum - RSS feed
Viewing all articles
Browse latest Browse all 77

set initialpose for AMCL in code

$
0
0
Hi all I followed the rviz source code 2D Pose Estimate which is the below function to set initialpose for AMCL in my own code. void InitialPoseTool::onPoseSet(double x, double y, double theta) It worked in publishing a single message to the topic initialpose. However this was not able to set the pose of the robot, because in rviz the pose of the robot never changed to the new one and in the console there also had not been showing any message like "[ROS_INFO] setting the robot pose to ..." as usual when we used the rviz 2D Pose Estimate tool. But I finally made it work by using the latched ros publisher rather than the normal publisher ros::Publisher advertise(const std::string& topic, uint32_t queue_size, bool latch = **true**) The question I want to raise here is why the normal publisher without latch could work in rviz while I have to use the latched version to publish the message to set the pose? Thanks all.

Viewing all articles
Browse latest Browse all 77

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>