ros-industrial-attic / fermi

Google Summer of Code Project: Cartesian Path Planner MoveIt Plug-in
Apache License 2.0
41 stars 33 forks source link

RViz locking up when a long ros/moveit task is running #14

Closed rkojcev closed 10 years ago

rkojcev commented 10 years ago

RViz is locking up when a long ros/moveit task is Running. This is especially noticeable after the execution of the Cartesian path we have created from the way-points.

To replicate the issue just load one of the saved way-points yaml files located in waypoints_data folder and execute the Cartesian path by pressing Simulate Cartesian Path button.

Further more, if we only have the RobotState visual enabled in the RViz environment the Robot is not simulated at all and just its end state is visualized. The Cartesian path is still executed in the background.

gavanderhoorn commented 10 years ago

From your description it sounds like you are invoking a synchronous method somewhere on the UI thread in RViz, or some other main event-processing thread within MoveIt itself.

I seem to remember you saying that RViz 'dims' when you execute a long trajectory. That would suggest it is the UI thread, or something that indirectly blocks it (by posting long-duration, synchronously executing events to it, fi).

rkojcev commented 10 years ago

@gavanderhoorn thanks a lot for your feedback, currently I am working on resolving the issue and the most resource demanding method is in the execution of the Cartesian path, I am working on putting the computational demanding functions like that one into separate concurrent process.

rkojcev commented 10 years ago

I have placed the execution of the Cartesian path into QtConcurrent::run, it seems that it resolves the problem with the blocking of the RViz environment when we execute the Cartesian path. However, if the MotionPlanning visual and the RobotModel visual are enabled in the RViz environment, I can notice that the visualization of the Robot is repeated, even though the cartesian path according to the MoveIt output is executed only once. In this case I have one "slower" visualization following exactly the same another visualization of the robot. I am wondering if this is normal behavior or it might be some other issue in the code causing this. @shaun-edwards, @jrgnicho and @gavanderhoorn any ideas? :)

jrgnicho commented 10 years ago

In regards to the repeated animation issue, the Motion Planning Plugin has an option for how the robot trajectory is displayed and I think there is a check box for looping the last trajectory. Unchecking that box should animate the arm only once. You might be able see a better animation of the arm if you use a RobotModel instead of a RobotState, although the RobotModel will only move if the /joint_states topic is being updated with new joint data during the trajectory execution.

rkojcev commented 10 years ago

@jrgnicho thanks a lot for the explanation. I made mistake in the previous comment, I meant RobotModel visual instead of RobotState.

After some testing of my own I will make another pull request with the updated code.

Thanks everyone for your help