How to use Universal Robot UR5 with tesseract (TrajOpt)
Currently working with STOMP and a universal robot UR5. (Kinetic)
First of all i use the UR5-package from github. Everything working fine. Next commands are used to start the robot connection, launch the planner STOMP and RVIZ simulation.
roslaunch ur_bringup ur5_bringup.launch robot_ip:=192.168.0.1
roslaunch ur5_moveit_config ur5_moveit_planning_execution.launch
roslaunch ur5_moveit_config moveit_rviz.launch config:=true
Next i run a small python file: rosrun ur5_moveit_chomp_config trajectory.py
This python file works perfectly in the simulation and goes from A to B. Next the trajectory is send to executing it and the real robot also moves from A to B. Everything is working fine. The topic with the trajectory is:
/move_group/monitored_planning_scene
I guess the driver listens to that topic... I also wrote a cpp-file for the same problem with the TrajOpt planner. Also working with RVIZ using tesseract-package.
But how do i send this trajectory to the real UR5 ? Tesseract topic is:
trajopt/display_tesseract_trajectory
How can i implement the tesseract trajectory with the UR5? Can i remap the topics?
Thanks in advance.
Asked by DieterWuytens on 2019-05-08 09:06:26 UTC
Answers
The topic with the trajectory is:
/move_group/monitored_planning_scene
I guess the driver listens to that topic..
No, that is not how things are connected.
The driver exposes a FollowJointTrajectory action server and MoveIt is a client of that server.
The topic you mention is involved in synchronisation of the planning scene, which is a MoveIt internal datastructure. It's got nothing to with execution of trajectories.
Asked by gvdhoorn on 2019-05-08 09:19:48 UTC
Comments
How can i send the trajopt/display_tesseract_trajectory
to the driver of the UR5?
Asked by DieterWuytens on 2019-05-08 09:30:28 UTC
Not. Or at least, not without transforming the data types.
Edit: the issues that @ChristophBrasseur links to in his comment points to this code for converting a Tesseract result into a FollowJointTrajectory
goal and then submitting that.
That would be roughly how you could do what you want.
Asked by gvdhoorn on 2019-05-08 09:31:38 UTC
I understand the code that is used in your link. But i have programmed it like this.
Please explain to me how to integrate the planning response etc? i don't use that in my code .. ? I used the cartesian path example from trajopt_ros moveit package.
Asked by DieterWuytens on 2019-05-09 04:40:25 UTC
I'm afraid I don't have time right now to go through 350+ lines of code and Tesseract/TrajOpt to come up with a suitable conversion implementation.
In general you'll want to take whatever TrajOpt gives you, convert that (somehow) into a FollowJointTrajectory
action goal and then submit that goal, using an action client, to your robot driver.
That would be the way to execute your planning results on the real robot (and not just a UR5 actually, any robot driver that exposes a FollowJointTrajectory
action server).
Asked by gvdhoorn on 2019-05-09 05:03:40 UTC
Thanks for the command. I tried implementing it with traj_msg = trajArrayToJointTrajectoryMsg(joint_names, traj_array, false, t);
and a bunch of other code as you referred to. Seems to work until my ur_driver says: "Received a goal without velocities". Any suggestions for that? My traj_array does only include positions as far as i know off.
Asked by DieterWuytens on 2019-05-09 08:26:33 UTC
You'll have to make sure the JointTrajectory
contains valid positions, timestamps and velocities. Otherwise the driver cannot execute it.
You may be able to use the Iterative Parabolic Time Parameterization that MoveIt comes with (or one of the alternative algorithms).
Asked by gvdhoorn on 2019-05-09 08:29:41 UTC
Timestamps can be added to the traj_array by using: pci.basic_info.use_time = true;
The traj_array has one extra column now. First 6 columns (6dof-robot) now 7 colomns with the timestamps.
But still the error of "received goal without velocities". Is there a tutorial of how to use the Iterative Parabolic Time Parameterization?
Asked by DieterWuytens on 2019-05-09 09:23:18 UTC
Issue was made on GitHub.
Asked by DieterWuytens on 2019-05-15 02:19:03 UTC
Comments
Sort of the same issue here: https://github.com/ros-industrial-consortium/trajopt_ros/issues/62
Asked by ChristophBrasseur on 2019-05-08 09:19:09 UTC