Ask Your Question
1

Motion planning using carrot planner

asked 2011-06-09 05:03:15 -0500

PKG gravatar image

updated 2011-06-17 12:26:28 -0500

mmwise gravatar image

I'm unable to get simple carrot planner code , for motion planning, up and running.

The problem I'm trying to write code for is: to use carrot planner to move the erratic gazebo robot from a start point to end point.Here are the problems I am facing:

(1) I doubt if my design is correct, or if there's a simpler way to solve the above problem. Currently, I start erratic_wg.launch within simulator_gazebo. Next, I have a tf::listener instance running in a separate program, excerpts from which are given below. The listener uses the carrot planner while transforming from base_link to map:

void transformPoint(const tf::TransformListener& listener) 
{

         geometry_msgs::PointStamped laser_point;
         laser_point.header.frame_id = "base_link";
              ...
         tf::TransformListener mytf(ros::Duration(10));

         costmap_2d::Costmap2DROS costmap("my_costmap", mytf);
         carrot_planner::CarrotPlanner cp  ;
         cp.initialize("my_carrot_planner", &costmap);
         try
         {
                geometry_msgs::PointStamped base_point;
                listener.transformPoint("map", laser_point, base_point);

                geometry_msgs::PoseStamped start  ;
                start.pose.position.x = 0 , start.pose.position.y = 0,
                start.pose.position.z = 0;
                geometry_msgs::PoseStamped end;
                end.pose.position.x = 5 , end.pose.position.y = 5,
                end.pose.position.z = 0;

                std::vector<geometry_msgs::PoseStamped> plan;
                cp.makePlan(start, end, plan);
                // Should I send a cmd_vel message now for each step of the plan?
        }
}

(2) When my costmap is initialized as above, the listener code segfaults. I have traced this to the constructor of Costmap2DPublisher called within Costmap2DROS constructor, but haven't gone deeper than this. I am using ros version 1.2.4 and the older version of the navigation stack (i.e. which contained nav_view). I am not sure how to specify the navigation stack version more precisely (i.e. repo revision, etc.). Also, the latest navigation stack doesn't build , as pcl_ros doesn't compile on my ros. So I stuck with a previous version I had downloaded around Nov. 2010. I can provide further details if necessary.

edit retag flag offensive close merge delete

1 Answer

Sort by ยป oldest newest most voted
1

answered 2011-06-22 11:02:27 -0500

eitan gravatar image

updated 2011-06-22 11:02:46 -0500

First off, navigation 1.2.4 is pretty old, its worth trying to update if you can. Second, you should probably be initializing both the costmap and the carrot planner outside of a ROS callback. As it stands right now, they'll be recreated every time the callback is called. Also, I'm not totally clear on what you're trying to do. Using the carrot planner in the way you're using it above won't even have the robot avoid obstacles while it drives. You might as well just publish velocity commands without doing collision checking. Perhaps the full navigation stack is better for your use case.

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

Stats

Asked: 2011-06-09 05:03:15 -0500

Seen: 1,182 times

Last updated: Jun 22 '11