Closed kdhRGT closed 2 years ago
Thank you very much for your inquiry.
is it worked in your pkg?
I think it works. In emcl2nav.launch
, a map server is launched. Please tell me when I should add some code for your demand. I can modify my code as everyone can conveniently use this package.
I think your emcl2.launch file has a mistyping
Oh I must fix it. Thank you!
Thank you so much for your fast reply!
This pkg used wheel odometry to guess the pose before correcting pose by LiDAR?
Oh, now I found the odometry receiving part.
bool EMcl2Node::getOdomPose(double& x, double& y, double& yaw)
{
geometry_msgs::PoseStamped ident;
ident.header.frame_id = footprint_frame_id_;
ident.header.stamp = ros::Time(0);
tf2::toMsg(tf2::Transform::getIdentity(), ident.pose);
geometry_msgs::PoseStamped odom_pose;
try{
this->tf_->transform(ident, odom_pose, odom_frame_id_);
}catch(tf2::TransformException e){
ROS_WARN("Failed to compute odom pose, skipping scan (%s)", e.what());
return false;
}
x = odom_pose.pose.position.x;
y = odom_pose.pose.position.y;
yaw = tf2::getYaw(odom_pose.pose.orientation);
return true;
}
But there is not working in my system so I am trying to change this part as subscribing ROS odometry topic.
I remember that I have implemented this part as the odometry information not from /odom topic but from tf. Did you check the tf information on your system?
Thank you so much, sir. I understand.
i am focusing on other projects sorry late!
I will write meaningful results if I have.
plz, wait for me hmm I will come soon~~~!!
Hello sir!
now i am doing experiments about emcl2
I have a simple question.
void LikelihoodFieldMap::setLikelihood(int x, int y, double range)
{
int cell_num = (int)ceil(range/resolution_);
std::vector<double> weights;
for(int i=0;i<=cell_num;i++)
weights.push_back(1.0 - (double)i/cell_num);
for(int i=-cell_num; i<=cell_num; i++)
for(int j=-cell_num; j<=cell_num; j++){
std::cout << "x y i j " << x << " " << y << " " << i << " " << j << std::endl;
double checkx = i+x;
double checky = j+y;
if(checkx > -1 && checky >-1){
likelihoods_[i+x][j+y] = std::max(likelihoods_[i+x][j+y],
std::min(weights[abs(i)], weights[abs(j)]));
std::cout << "likelihoods_[i+x][j+y]" << likelihoods_[i+x][j+y] << std::endl;
}
}
}
in this code, in my map, sometimes "i+x" and "j+y" are (-) minus
so I made the program die.
Can I ignore the likelihoods_initialization based on my own map like this?
I’m sorry I’m late.
When a map has free cells at its edge, they will be minus. I think that i+x and i+y must be checked.
I will add the check. Thank you very much.
I fixed it (but it has never been tested). Please update your repo.
Hello sir
thank you so much to share your great work.
I have two questions.
I publish the map by map server for subscribing map
is it worked in your pkg?
also
I think your emcl2.launch file has a mistyping
this should be changed as...
can you help me a little bit?
I wanna experiment with your great work.
thank you so much
best regards