Ask Your Question
1

How can I disperse amcl particles in specific area?

asked 2016-03-31 06:46:01 -0500

Orhan gravatar image

updated 2016-03-31 08:16:03 -0500

I'm using amcl's global_localization service. I have a big map and it has a lot of same shapes. amcl is getting confused easiliy. How can I disperse particles on specific local area?

edit retag flag offensive close merge delete

1 Answer

Sort by ยป oldest newest most voted
2

answered 2016-06-09 05:17:42 -0500

Orhan gravatar image

Instead of global_localization, I'm using publishing to /initialpose topic method in my custom package. Now I can set covariance matrix to disperse particles in specific area. X_DEVIATION_WEIGHT, Y_DEVIATION_WEIGHT and YAW_DEVIATION_WEIGHT parameters are globally declared;

bool publishToInitialPose(geometry_msgs::PoseWithCovarianceStamped msg, ros::Publisher publisher, bool last_publish = false)
{
    msg.header.stamp = ros::Time::now();
    msg.header.frame_id = "/" + NAMESPACE + "/map";
    msg.pose.pose.position.x = POS_X;
    msg.pose.pose.position.y = POS_Y;

    msg.pose.pose.orientation.x = 0.0;
    msg.pose.pose.orientation.y = 0.0;
    msg.pose.pose.orientation.z = ORI_Z;
    msg.pose.pose.orientation.w = ORI_W;

    msg.pose.covariance[0] = X_DEVIATION_WEIGHT; 
    msg.pose.covariance[7] = Y_DEVIATION_WEIGHT; 
    msg.pose.covariance[35] = YAW_DEVIATION_WEIGHT; 
    publisher.publish( msg );
}
edit flag offensive delete link more

Your Answer

Please start posting anonymously - your entry will be published after you log in or create a new account.

Add Answer

Question Tools

2 followers

Stats

Asked: 2016-03-31 06:46:01 -0500

Seen: 193 times

Last updated: Jun 09 '16