navfn ros priority blocks
As code shows below, i do not understand the const 'INVSQRT2' and the variable 'curT',what do they play roles in code,how can i understand them
#define INVSQRT2 0.707106781
float le = INVSQRT2*(float)costarr[n-1];
float re = INVSQRT2*(float)costarr[n+1];
float ue = INVSQRT2*(float)costarr[n-nx];
float de = INVSQRT2*(float)costarr[n+nx];
if (pot < curT) // low-cost buffer block
{
if (l > pot+le) {
push_next(n-1);
}
if (r > pot+re)
{
push_next(n+1);
}
if (u > pot+ue)
{
push_next(n-nx);
}
if (d > pot+de)
{
push_next(n+nx);
}
}
else
{
if (l > pot+le) {
push_over(n-1);
}
if (r > pot+re)
{
push_over(n+1);
}
if (u > pot+ue)
{
push_over(n-nx);
}
if (d > pot+de)
{
push_over(n+nx);
}
}
This is not really a question. Also, you are lacking a lot of context. What is this code, where is it from, what should it do and most importantly: Where do
curT
etc come from? This only appears once in this code. How do you think we should be able to get this?INVSQRT2
, however, is "invert squareroot of 2", so1/sqrt(2)
.the code is in the navfn package.(ros-indigo/navigation/navfn/src/navfn.cpp). link: http://www.ros.org/doc/diamondback/ap... >
I know INVSQRT2=1/sqrt(2),but I do not know why costarr should multiply it
alright, this sounds more like a question. Cannot help with that, though. Maybe check the details of Djikstra alogrithm? Note, you linked to the diamondback source. This is quite old. better always use the link to the Code Api on the ROS wiki...
Alright,whatever,thanks