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

Interact with Rviz, send multiple goals to path planner

asked 2015-10-28 11:02:28 -0500

Jose Luis gravatar image

Hi all,

I want to send multiple goals to path planner (move_base) using Rviz. I mean, normally the 2D Nav Goal button is used to send an unique goal to the planner. My question is if is possible to concatenate goals clicking in different points on the map.

Is there any Rviz functionality or is necessary to install a plugin or create something ad-hoc "home-made"?

Thank you very much in advance.

edit retag flag offensive close merge delete

4 Answers

Sort by ยป oldest newest most voted
1

answered 2015-12-03 02:31:53 -0500

Jose Luis gravatar image

Finally, I have used a combination of two packages that are provided by ROS. On one hand I have used a RViz plugin example for creating a new plugin on Rviz interface. The example that I took is plant_flag_tool in rviz_plugin_tutorials package. Once I have a button in Rviz menu, I have created a custom interactive marker which is capable of move in XY plane and rotate in Z. By this way is possible to send a position and orientation to the path planner. Each time that the user presses the button plugin on Rviz menu a new custom marker (new goal) is created.

edit flag offensive delete link more
0

answered 2015-10-28 12:27:58 -0500

Naman gravatar image

I am not sure whether its possible to do it using RVIZ (I might be wrong) but you can use actionlib to send multiple goals. Example Code:

typedef actionlib::SimpleActionClient<move_base_msgs::MoveBaseAction> MoveBaseClient;

// tell the action client that we want to spin a thread by default
MoveBaseClient ac("move_base",true);

std::vector<move_base_msgs::MoveBaseGoal> plan;

// Add multiple goals to plan of the type move_base_msgs::MoveBaseGoal
// Then, send it one by one:

for (int i = 0;i<plan.size();i++){
        ac.sendGoal(plan[i]); // Current Goal
        ac.waitForResult();

        if(ac.getState() == actionlib::SimpleClientGoalState::SUCCEEDED)
            ROS_INFO("Reached Goal successfully!");
        else
            ROS_INFO("Failed!");
    }

Hope it helps.

edit flag offensive delete link more

Comments

Thank you very much for your soon answer. This is a good solution to send goals to the path planner, I going to take into account. But my issue is more concrete, I need to know how to get/take different goals clicking in the map showed by Rviz.

Jose Luis gravatar image Jose Luis  ( 2015-10-29 05:42:06 -0500 )edit

The idea is click in 'n' points to afterwards generate 'n-1' paths between those points. I do not know if it is clear??

Jose Luis gravatar image Jose Luis  ( 2015-10-29 05:43:58 -0500 )edit

The question is clear..I just don't know whether it can be done or not.

Naman gravatar image Naman  ( 2015-10-29 15:12:49 -0500 )edit
0

answered 2015-10-30 13:31:47 -0500

l0g1x gravatar image

updated 2015-11-03 10:17:51 -0500

Doesn't seem like there is any queueing done according to the source code for rviz here . That would be a cool pull request though to give a user the option on whether to queue goals sent from RViz or not.

EDIT: Sorry, I meant that it doesn't seem like there is any queining.

edit flag offensive delete link more

Comments

Does seem like there is any queueing done [..]

Should this be "Doesn't seem like .." ?

gvdhoorn gravatar image gvdhoorn  ( 2015-10-31 08:29:18 -0500 )edit

Oops! Sorry, thanks for catching that

l0g1x gravatar image l0g1x  ( 2015-11-03 10:18:21 -0500 )edit
0

answered 2015-11-09 09:51:12 -0500

updated 2015-11-09 09:52:20 -0500

@Jose This tutorial might help you. https://github.com/ipa320/ipa_seminar...

edit flag offensive delete link more

Question Tools

1 follower

Stats

Asked: 2015-10-28 11:02:28 -0500

Seen: 1,733 times

Last updated: Dec 03 '15