ROS Resources: Documentation | Support | Discussion Forum | Index | Service Status | ros @ Robotics Stack Exchange
Ask Your Question

pengjiawei's profile - activity

2022-09-21 01:35:28 -0500 received badge  Famous Question (source)
2022-03-15 21:07:37 -0500 received badge  Notable Question (source)
2022-02-09 11:02:55 -0500 received badge  Notable Question (source)
2020-06-14 06:50:45 -0500 received badge  Notable Question (source)
2019-11-13 06:36:25 -0500 received badge  Popular Question (source)
2019-05-20 02:19:58 -0500 marked best answer I am a little confused about costMap and globalPlanner

Hi,

for (unsigned int i = 0; i < size_y; ++i)  
            {    
               for (unsigned int j = 0; j < size_x; ++j)

                {

                unsigned char value = new_map->data[index];
                costmap_[index] = interpretValue(value);
                  ++index;

                }
            }

the above is from ros navigation package , /navigation/costmap_2d/plugins/static_layer.cpp 198~206 it update the map according to laserScan.But I am confused why it update costmap from 0 to xy not from x to xy

costmap use the Index(x*nx+y) to represent the two dimensional coordinate,doesn't it?

I have this confusion becuase I see that in globalPlanner,the dijkstra.cpp use index() to getCost,and then it calculatePotentials

dijkstra.cpp 95~116


int k = toIndex(start_x, start_y);
if(precise_)
{
    double dx = start_x - (int)start_x, dy = start_y - (int)start_y;
    dx = floorf(dx * 100 + 0.5) / 100;
    dy = floorf(dy * 100 + 0.5) / 100;
    potential[k] = neutral_cost_ * 2 * dx * dy;
    potential[k+1] = neutral_cost_ * 2 * (1-dx)*dy;
    potential[k+nx_] = neutral_cost_*2*dx*(1-dy);
    potential[k+nx_+1] = neutral_cost_*2*(1-dx)*(1-dy);//*/

    push_cur(k+2);
    push_cur(k-1);
    push_cur(k+nx_-1);
    push_cur(k+nx_+2);

    push_cur(k-nx_);
    push_cur(k-nx_+1);
    push_cur(k+nx_*2);
    push_cur(k+nx_*2+1);
}

when it push_cur,it calls the function getCost() in dijkstra.h.But I find that float c = costs[n] in Function getCost() n represents index(x*nx+y)

So,why we use x and y when we put value into char* costmap,But we use index() get value from costmap. where is the value from costmap[0] to costmap [nx],nx means the x size of map.

help me , Did I make a mistake

I wanna know costmap use x and y or index to represent the values in map

thx~ PS:why MarkDown Grammar ``` can't be used in this

2019-04-20 07:46:48 -0500 received badge  Teacher (source)
2019-04-18 09:48:58 -0500 received badge  Popular Question (source)
2019-04-08 01:08:11 -0500 marked best answer what is the meaning of transformGlobalPlan in goalfunction.cpp line 80

/**

  • @brief Transforms the global plan of the robot from the planner frame to the frame of the costmap,

  • selects only the (first) part of the plan that is within the costmap area.

  • @param tf A reference to a transform listener
  • @param global_plan The plan to be transformed
  • @param robot_pose The pose of the robot in the global frame (same as costmap)
  • @param costmap A reference to the costmap being used so the window size for transforming can be computed
  • @param global_frame The frame to transform the plan to
  • @param transformed_plan Populated with the transformed plan */

bool transformGlobalPlan(const tf::TransformListener& tf,

const std::vector<geometry_msgs::PoseStamped>& global_plan,
  const tf::Stamped<tf::Pose>& global_robot_pose,
  const costmap_2d::Costmap2D& costmap,
  const std::string& global_frame,
  std::vector<geometry_msgs::PoseStamped>& transformed_plan);

what is the meaning of this function? I have got the global_plan from the globalPlanner in the global_frame,have I? Why and when should I call this function? and what is "the planner frame",Does it equal to the global_frame?

2019-03-02 11:45:58 -0500 received badge  Famous Question (source)
2018-08-11 08:52:07 -0500 received badge  Famous Question (source)
2018-07-16 07:51:23 -0500 received badge  Student (source)
2018-07-13 02:42:59 -0500 commented question navigation using hector_slam odometry and amcl not working

maybe you can debug tf first,such as viewing tf tree

2018-07-13 02:26:37 -0500 commented question navigation using hector_slam odometry and amcl not working

oh ,Ok.and then what does the "essai1.launch" looks like in amcl package?

2018-07-12 20:05:33 -0500 commented question navigation using hector_slam odometry and amcl not working

what does the odom publisher looks like?

2018-07-12 13:00:51 -0500 received badge  Notable Question (source)
2018-07-11 02:15:14 -0500 commented question navigation using hector_slam odometry and amcl not working

There might be a problem.

2018-07-10 20:44:30 -0500 commented question navigation using hector_slam odometry and amcl not working

what is the package "tf_hector_odom"

2018-07-10 20:35:49 -0500 commented question catkin_make android_core SDK Directory does not exist

try catkin_make clean && catkin_make

2018-06-23 04:29:05 -0500 commented question Can we ensure subscribing order same as publishing order in ROS given multiple publishers on a same topic?

does "a same topic M" means that the name and type of topic is same?

2018-06-21 03:19:36 -0500 commented question Running two subscribers concurrently in the same node

try this while(n.ok()){ subscriber; ros::spinOnce(); }

2018-06-20 22:14:33 -0500 commented question dwa_local_planner

what does the global plan looks like?Is there only local plan in the video?

2018-06-20 22:13:49 -0500 commented question dwa_local_planner

what does the global plan looks like?

2018-06-20 20:52:05 -0500 commented question How to use a different world with Nav2D tutorial?

map_server load a .yaml file

2018-06-12 02:00:32 -0500 commented question How to create our own global planner

maybe you can publish the goals one by one?

2018-06-12 01:56:41 -0500 commented question Help needed with EKF fusion

did odom have no position?

2018-06-11 23:03:19 -0500 commented question How to get x,y from /move_base/NavfnROS/plan

it's a list,operator[]

2018-06-07 20:52:10 -0500 commented question nav2d exploration with turtlebot and lidar: no map available

what can you see if you do rostopic echo /base_scan and rostopic echo /map

2018-06-05 16:28:05 -0500 received badge  Popular Question (source)
2018-06-04 20:33:42 -0500 commented question how to complete coverage path?

i think i almost figure it out, there is a paper talk about this

2018-06-04 04:58:05 -0500 commented question ROS navigation can't rotate 180°

what does your configuration of base_local_planner look like

2018-06-04 04:51:36 -0500 edited question how to complete coverage path?

how to complete coverage path? hello,as you see in the picture. I just wanna a optimal coverage algorithm.the robot st

2018-06-04 04:49:28 -0500 asked a question how to complete coverage path?

how to complete coverage path? hello,as you see in the picture. I just wanna a optimal coverage algorithm.the robot st

2018-05-25 20:00:12 -0500 commented question Why does the global planner ignore the robots footprint?

Did you add the inflation layer ?

2018-05-25 20:00:12 -0500 received badge  Commentator
2018-05-24 21:33:06 -0500 commented answer Changing a variable inside a running node

yes,try this dynamic_reconfigure tutorial and you can figure it out

2018-05-24 21:01:47 -0500 commented question Why does the global planner ignore the robots footprint?

have you ever configured the footprint in global_costmap

2018-05-24 20:59:01 -0500 answered a question Path planning for hector_slam

try this hector_navigation,you can focus on hector_exploration_planner

2018-05-24 20:51:04 -0500 answered a question Changing a variable inside a running node

do you means rqt_reconfigure

2018-05-09 00:35:40 -0500 received badge  Notable Question (source)
2018-04-25 22:03:21 -0500 answered a question Localisation in a dynamic environment

amcl is in package navigation github,here is navigation wiki ,the amcl called adaptive monte calro localization will wor

2018-04-17 20:13:00 -0500 marked best answer Can I update staticLayer with the laserData?

I want to update static layer with the data from lidar.Is that OK?

My thought is that call this function StaticLayer::incomingMap(new_map),the parameter "new_map"is from the lidar?

Why it can be done? or why not? thanks

2018-04-13 21:50:51 -0500 answered a question How can i display a map (map-built save in bag file) with hector slam on android mobile app?

i have never try it in PI3 but I did it between my ubuntu16.04 and my android phone. There is a OccupancyGridLayer at li

2018-04-08 22:40:26 -0500 commented question How can i display a map (map-built save in bag file) with hector slam on android mobile app?

android_apps/map_nav that might help

2018-03-28 03:33:17 -0500 commented question Turtlebot_navigation issue:local_map drifts after a long-distance movement.

what if you set the goal near your turtlebot?

2018-03-22 20:14:14 -0500 commented question No visualization in RViz when publishing on (collision_object) topic

Did you set the global frame of rviz

2018-03-16 01:12:46 -0500 answered a question Setup CLion with ROS

by the way . If you don't wanna build all projects in directory <your workspace path>/src , you can add -DCATKIN_W

2018-03-16 01:06:05 -0500 commented question Real Robot and Rviz path is not matching

maybe you can check your topic first with command rostopic list and check whether your controller has received velocity

2018-03-15 22:35:08 -0500 edited answer sensor_msgs - Can't build tutorial project

try this source /opt/ros/kinetic/setup.bash