-
Notifications
You must be signed in to change notification settings - Fork 164
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Drive gen3 using PreComputedJointTrajectory #286
Comments
Hi @ch1hha0, You can refer to the old joint trajectory server that was using PlayPreComputedJointTrajectory to execute MoveIT trajectories ros_kortex/kortex_driver/src/non-generated/driver/pre_computed_joint_trajectory_action_server.cpp Lines 91 to 131 in 0b422bb
Quickly looking at your code, I think you are missing a mode to your PreComputedJointTrajectory goal = kortex_driver.msg.PreComputedJointTrajectory()
goal.mode = kortex_driver.msg.TrajectoryContinuityMode.TRAJECTORY_CONTINUITY_MODE_POSITION # not sure if this is the correct syntax If you don't specify this field, it will defaults to 0, which is "TRAJECTORY_CONTINUITY_MODE_UNSPECIFIED" Regards, |
Hi @felixmaisonneuve , |
You can use I am not sure why your |
The trajectory I am currently using for testing is shown below. In simple terms, I am trying to use the robotic arm to perform the task of writing.
Furthermore, I found that FollowJointTrajectoryAction seems to be usable, but it cannot receive many points, not even 500. I also tried using the MATLAB example 'Send Precomputed Trajectory to the Robot', but an error message appeared when sending the trajectory to FollowJointTrajectoryAction. However, when I sent a trajectory with only a few points to FollowJointTrajectoryAction, it worked. This contradicts the description that PreComputedJointTrajectory can receive up to 30,000 points.
This is the environment I am using. |
Additionally, I also set the |
Hi @ch1hha0, Have you tried using If you are using the matlab API, I would suggest to look at our github repo rather than using the MatLab documentation. However, our MatLab API is still at Kortex2.2.0, so waypoints are not available on it, but the functions you mentionned so far should be. I am sure I fully understand what you are doing to get the error message. Are you using MatLab or FollowJointTrajectoryAction? Best, |
Sorry, I haven't been using this arm recently, so I haven't been able to respond. But what I can confirm is that I have tried using a |
I looked into this a bit and played with Turns out your trajectory could fail with an event
This might explain why your arm does not move (because the Trajectory is invalid and the call fails) but nothing is printed in your terminal. If that's the case, you can use the I did not test specifically for your test trajectory. I will try to add an example for In the meantime, you can try this and see what the problem is. Best, |
Thank you, Felix. I haven't been using this robotic arm recently, but I will continue to provide feedback if there are any new issues. I'm also looking forward to your adding an example for the |
Hello, I've been recently attempting to use
When I use MoveIt's
I'd like to understand the correct way to use As far as I know, in previous versions, it was possible to use |
Hi @ch1hha0, Yes, we changed the joint action server with the Kortex2.3 release. It was previously pre_computed_joint_trajectory_action_server and it was using the You could use the old file that you could get from a commit older than #154 This was never used on the noetic branch however. I do not know how much work this would imply. I remember going over the same topic in another issue, but I can't find it. Best, |
Hello, I've tried using
I determined the meaning of each column of data in the
There are a total of 14601 trajectory points, which doesn't exceed the hard limit of
However, this still doesn't make the robotic arm move. The error message obtained using
I've consulted TrajectoryErrorType.md, but I believe the trajectory should be valid since it's provided by matlab_kortex. I've also tried changing the goal.mode to other values and specifying |
Hello, I have recently been using the Service method to use PreComputedJointTrajectory and have successfully moved the robot arm. However, I found that the description of the hard limits for precomputed_joint_trajectories in matlab_kortex (The acceleration limit of every joint must be respected for all the trajectory points. The trajectory will be rejected if any of the points contain an illegal acceleration. The hard acceleration limit for each joint is 1 degree / second ^ squared.) is incorrect. In the trajectory points provided in trajectory.mat, the maximum acceleration values for each joint are: |
Hi @ch1hha0, def play_pre_compute(traj):
goal = PreComputedJointTrajectory()
goal.mode = kortex_driver.msg.TrajectoryContinuityMode.TRAJECTORY_CONTINUITY_MODE_POSITION
for i in traj:
joint_list = PreComputedJointTrajectoryElement()
joint_list.joint_angles = i['positions']
joint_list.joint_speeds = i['velocities']
joint_list.joint_accelerations = i['accelerations']
joint_list.time_from_start = i['time_from_start']['secs']+i['time_from_start']['nsecs']
goal.trajectory_elements.append(joint_list)
service = rospy.ServiceProxy('/my_gen3/base/play_pre_computed_joint_trajectory', PlayPreComputedJointTrajectory)
resp1 = service(goal) The pre compute trajectory is made my moveit: positions: [-0.7116887886428893, 1.2937886912747407, -1.2954718090836703, -0.9481631123720398, 0.2918366823914488, -0.3021803667758034, 1.054209587767749]
velocities: [0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0]
accelerations: [9.237055564881302e-14, -2.418360650624507e-13, 2.3148150063434514e-13, -5.685035775471192e-14, -2.7200464103316335e-14, -3.147482274812319e-14, 2.6989521728637555e-13]
effort: []
time_from_start:
secs: 0
nsecs: 0
-
positions: [-0.7115911248425385, 1.293793204077657, -1.2953108883778615, -0.9481476267502637, 0.29164175465029113, -0.30203616995857485, 1.054325526879847]
velocities: [0.00864197345499454, 0.0003993242416344238, 0.014239385145404182, 0.001370275699313958, -0.01724856455181653, 0.012759538972555842, 0.010259100358032958]
accelerations: [0.5098013452173966, 0.023556660596731924, 0.8399999999999508, 0.08083436016872421, -1.01751543873402, 0.7527019339320946, 0.6051977815578]
effort: []
time_from_start:
secs: 0
nsecs: 33903298
-
positions: [-0.6859682906275401, 1.2949771719404148, -1.2530921281833007, -0.944084857146164, 0.24050099238579642, -0.2642050479982637, 1.0847430268915985]
velocities: [0.15685905637290967, 0.007248069443441325, 0.25845676671773077, 0.02487165162964606, -0.3130758933102061, 0.2315963192217543, 0.18621126410260352]
accelerations: [0.46170088359478606, 0.02133405710688794, 0.7607448388631067, 0.0732075265489838, -0.9215114505719482, 0.6816834660013223, 0.5480965342994647]
effort: []
time_from_start:
secs: 0
nsecs: 339032980
-
positions: [-0.6602477926121908, 1.2961656526060892, -1.2107124472829311, -0.9400066019202882, 0.18916530238014406, -0.22622972922072404, 1.115276466015448]
velocities: [0.1987437246048692, 0.009183456478019892, 0.327470161140694, 0.03151290589304014, -0.39667374367306796, 0.293437409042446, 0.23593358934373923]
accelerations: [0.13012036652521616, 0.006012540648811779, 0.21439941048915984, 0.02063195138981042, -0.259707988366871, 0.19211767965366094, 0.15446910428015811]
effort: []
time_from_start:
secs: 0
nsecs: 480577976
...
So I just wondering do you have any suggestion for my code. Thanks. |
Hi @shi00317 , |
Hi all, The robot not moving when trying to launch a PreComputed trajectory indicates that at least one point of the trajectory is not within the limits of the arm. As per our documentation in matlab_kortex, here are the validation that the robot does before launching the trajectory:
To find out which point(s) triggered the rejection of your trajectory, as indicated above, you should refer to the GetTrajectoryErrorReport service (see here). It has been known for a while that the trajectories generated by MoveIt can often exceed the robot's acceleration limits. The issue has been solved in our ROS2 implementation which uses our low-level interface instead of the PreComputedTrajectory endpoint. In these cases, MoveIt still exceeds the limits of the robot, but the robot provides a best effort until it ends up either lagging too far behind the commanded trajectory or, in most cases, it catches up. As mentioned in @ch1hha0 's previous post, continuous trajectories can also be implemented directly using the low-level API outside of ROS. Hope this helps. *Edit: The maximum acceleration being 1 deg/s^2 is indeed a mistake. The actual value is 1 rad/s^2, as indicated in our User Guide. |
Closing because of inactivity. Please reply to this thread to reopen. Best, |
Excuse me, does release 2.3.0 support using PreComputedJointTrajectory to drive gen3 7dof in ROS? I want to control the robotic arm in joint space, and I have written a program using PreComputedJointTrajectory to drive gen3. However, gen3 did not move, and there was no error message when the program was running. The following is part of the code:
The
plan
is computed using MoveIt to generate a path. If this control method works well, I plan to explore other algorithms to generate paths in the future.The text was updated successfully, but these errors were encountered: