0
$\begingroup$

Rosanswers logo

I am working with ROS Indigo and MoveIt! and I already set up my robot through the setup assistant, and In Rivz I can see the start and goal state, in green and orange. I can manually move the orange goal state from Rviz and then plan and execute a trajectory in order to reach it. Otherwise, I have a piece of code that sets a goal trajectory and plans and executes the whole trajectory to it.

But I would like to just move the (orange) goal state to a new position through a piece of code, without planning any trajectory. Just changing the goal state. How can I do it?


Originally posted by HenrySleek on ROS Answers with karma: 53 on 2017-03-20

Post score: 1


Original comments

Comment by v4hn on 2017-03-21:
Please stop editing your posts over and over again. This sends out notification emails every time to everyone who watches ros-answers.

Comment by HenrySleek on 2017-03-22:
Oh damn, I am sorry, I didn't know. I just wanted to have it pop up at the top of the question list in the Home page. I will stop now that I have an answer.

Comment by levi strauss on 2018-07-03:
Hey you said that you had a piece of code that sets a goal trajectory and plans and executes that trajectory? I am struggling to figure out how to do this, would you mind giving some details?

$\endgroup$

1 Answer 1

0
$\begingroup$

Rosanswers logo

MoveIt's RViz display is mostly independent. The orange goal state corresponds to the goal state of the display only. There is no such thing as a "global goal state".

So actually you are looking for a way to tell the motion planning display to update the robot state it maintains as its goal state. Others asked for more general remote-control functionality of the whole motion planning display in the past. There is no satisfying implementation of this at the moment. Someone implemented a small part of it a while ago, but apparently lost interest. Since then, nobody provided patches to improve on the current state...

So this is what you can do out of the box:

If you check the "Allow External Comm." box in the planning tab, then you can send an std_msgs/Empty message to the /rviz/moveit/update_goal_state topic and the goal state will be set to the current state of the robot.

This is setup here: https://github.com/ros-planning/moveit/blob/kinetic-devel/moveit_ros/visualization/motion_planning_rviz_plugin/src/motion_planning_frame.cpp#L212

and implemented https://github.com/ros-planning/moveit/blob/kinetic-devel/moveit_ros/visualization/motion_planning_rviz_plugin/src/motion_planning_frame_planning.cpp#L430 .

It is pretty straight-forward and at most an afternoon of work to add another callback that receives a moveit_msgs/RobotState.msg and updates the start state or goal state with it.

A patch for this (and a pull-request for the moveit repository) would be awesome!


Originally posted by v4hn with karma: 2950 on 2017-03-21

This answer was ACCEPTED on the original site

Post score: 4


Original comments

Comment by HenrySleek on 2017-03-21:
I checked that code and indeed it's really a pity that nobody tried to expand it. Anyway, maybe it is enough to call a planning_display_->setQueryGoalState(state); setting the wanted state. Though, trying it, I have the following problem: http://answers.ros.org/question/257528/include-qwidget/

Comment by v4hn on 2017-03-21:
Yes and no. You can't do that from outside the rviz display, i.e. from your own node. You can just add another callback and subscriber though, that receives a moveit_msgs/RobotState.msg and calls planning_display_->setQueryGoalState() with that one.

Comment by HenrySleek on 2017-03-22:
I see. But I prefer not modifying the source code, since now it's installed with binaries and I didn't want to put my hands on it. Is there a way for doing it with MoveIt! installed from binaries?

Comment by v4hn on 2017-03-22:
It is quite easy to compile moveit locally (see install section on the website). If you implement the missing function and add a pull-request to the repository, we could have it in the next release and then you don't need your own source build anymore :) This is how open source contributions work...

Comment by v4hn on 2017-03-22:
If you are not willing to edit MoveIt source code, then no. You can't change the goal start arbitrarily (until someone contributed this functionality).

Comment by phy on 2018-04-04:
A tested patch is available here: https://github.com/phy25/moveit/tree/ext-RobotState . A PR will be made soon.

Comment by RicoJ on 2020-11-13:
Hi, I know this is kinda old, but recently I'm running into the same challenge. I am trying to send goal states through /rviz_moveit_motion_planning_display/robot_interaction_interactive_marker_topic/update, but I saw that Rviz's display update rate become significantly slower. I guess you can verify this by trying the same thing.

Right now I am trying to increase Rviz display's speed. Any idea?

$\endgroup$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.