jmiseikis / ur5_inf3480

Demo code for controlling UR5 using ROS and MoveIt!
28 stars 8 forks source link

Some doubts about moveRobotCartesianPath #4

Open WwYyFan opened 5 years ago

WwYyFan commented 5 years ago

@jmiseikis Hi,I have read your code,and I have some doubts about the function moveRobotCartesianPath

// Get robot trajectory to which joint speeds will be added
robot_trajectory::RobotTrajectory robot_move_trajectory(group.getCurrentState()->getRobotModel(), "manipulator");

This line of the code comment "Get robot trajectory to which joint speeds will be added" But I can't find where the code changed the speed.

jmiseikis commented 5 years ago

Hi, the joint speeds are not modified in this part of the code. What the comment meant is that the command calls an internal function of moveit library, which converts the Cartesian coordinate trajectory to robot joint trajectories and then calculates needed joint speeds to execute it, and then sends it to the robot controller to start the movement.

Justas

On Wed, Oct 10, 2018, 09:28 WwYyFan notifications@github.com wrote:

@jmiseikis https://github.com/jmiseikis Hi,I have read your code,and I have some doubts about the function moveRobotCartesianPath https://github.com/jmiseikis/ur5_inf3480/blob/master/src/inf3480_move_robot.cpp

// Get robot trajectory to which joint speeds will be added robot_trajectory::RobotTrajectory robot_move_trajectory(group.getCurrentState()->getRobotModel(), "manipulator");

This line of the code comment "Get robot trajectory to which joint speeds will be added" But I can't find where the code changed the speed.

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/jmiseikis/ur5_inf3480/issues/4, or mute the thread https://github.com/notifications/unsubscribe-auth/AB1UMEPNWTX3em5VrJLrf65otbq6uy_nks5ujaGkgaJpZM4XUupO .

WwYyFan commented 5 years ago

@jmiseikis Thanks for your reply ! I deleted these two lines of code.

// Get robot trajectory to which joint speeds will be added
robot_trajectory::RobotTrajectory robot_move_trajectory(group.getCurrentState()->getRobotModel(), "manipulator");
// Second get a RobotTrajectory from trajectory
robot_move_trajectory.setRobotTrajectoryMsg(*group.getCurrentState(), trajectory)

and the robot can still move.

WwYyFan commented 5 years ago

@jmiseikis I still don't understand what the purpose of these two lines of code is.

jmiseikis commented 5 years ago

@WwYyFan interesting observation! Maybe MoveIt changed a bit since this code was written and now allows to execute with just group.computeCartesianPath now. On the other hand, in case you would want to compute path for just part of the robot, not the whole manipulator, the robot_move_trajectory.setRobotTrajectoryMsg allows you to do that.

WwYyFan commented 5 years ago

@jmiseikis Thanks a lot ! Another problem is When I call this function computeCartesianPath to control the robot arm,I got an unsmooth trajectory.Have you encountered this problem?

jmiseikis commented 5 years ago

Hm... I think most of the time I was getting quite smooth trajectories. What planning algorithm do you use? There are multiple in moveit and they all act a bit different. You can see the list of planning algorithms in a drop-down menu in rviz. And do you use real robot or simulator?

On Wed, Oct 10, 2018, 10:46 WwYyFan notifications@github.com wrote:

@jmiseikis https://github.com/jmiseikis Thanks a lot ! Another problem is When I call this function computeCartesianPath to control the robot arm,I got an unsmooth trajectory.Have you encountered this problem?

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/jmiseikis/ur5_inf3480/issues/4#issuecomment-428489640, or mute the thread https://github.com/notifications/unsubscribe-auth/AB1UMPvES0rHDXP-aSJE6TQXRyvDYdNmks5ujbPKgaJpZM4XUupO .

WwYyFan commented 5 years ago

I use real robot and Planning algorithm I use the default “unspecified"

jmiseikis commented 5 years ago

My suggestion would be to try out different planning algorithms and see if you get smoother motions

On Wed, Oct 10, 2018, 11:00 WwYyFan notifications@github.com wrote:

I use real robot and Planning algorithm I use the default “unspecified"

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/jmiseikis/ur5_inf3480/issues/4#issuecomment-428494179, or mute the thread https://github.com/notifications/unsubscribe-auth/AB1UMGi2kjuM-2E9KPB55WKf3OSBaTGYks5ujbcdgaJpZM4XUupO .

WwYyFan commented 5 years ago

Thank you for your suggestion, I will try to use other planning algorithms.