Ask Your Question
0

Calculate velocity and acceleration when joint positions are provided

asked 2019-01-23 05:06:09 -0600

shyamashi gravatar image

Hello, I am working Ubuntu 16.04, Ros-Kinetic and using 7-DOF panda manipulator arm (all rotary joints). I have a function which gives me the joint_positions as [ [q1, q2, ..q7], [q1+dq1, q2+dq2....., q7+dq7], ....... [q1+ndq1, q2+ndq2,......., q7+n*dq7]] I want to create a joint trajectory just like the group.plan() function in moveit. This moveit function generates velocities, acceleration, time_from_start etc which then is fed to group.go() or group.execute(). I would like to use exactly the same functionality but with my joint positions in the trajectory_msgs\JointTrajectory message.

Is there a way to use some functions to calculate the velocities, accelerations etc? I am hoping to find something so that I can use the following function to create the jointTrajectory msg ```

def create_trajectory(positions, velocities, accelerations, t):
    joint_trajectory = JointTrajectory()
    for i in range(0, len(q_list)):
        point = JointTrajectoryPoint()
        point.positions = list(q_list[i])
        point.velocities = list(v_list[i])
        point.accelerations = list(a_list[i])
        point.time_from_start = rospy.Duration(t[i])
        joint_trajectory.points.append(point)
    joint_trajectory.joint_names = self.joint_names
    return joint_trajectory

```

Any help would be really appreciated. Thanks

Ash Babu

edit retag flag offensive close merge delete

1 Answer

Sort by ยป oldest newest most voted
0

answered 2019-01-23 05:09:08 -0600

gvdhoorn gravatar image

Take a look at Time Parameterization as provided by MoveIt.

It's not perfect, but it's a start.

edit flag offensive delete link more

Comments

Thanks for the reply. This seems to be exactly what I need. The only problem is I work in Python and not really familiar with C++. Is there some way I can call Iterative Spline Parameterization in Python?

shyamashi gravatar imageshyamashi ( 2019-01-23 05:50:00 -0600 )edit

I'm not sure whether the Python move group API exposes this. I don't really use Python with MoveIt unfortunately.

gvdhoorn gravatar imagegvdhoorn ( 2019-01-23 07:04:34 -0600 )edit

Your Answer

Please start posting anonymously - your entry will be published after you log in or create a new account.

Add Answer

Question Tools

1 follower

Stats

Asked: 2019-01-23 05:06:09 -0600

Seen: 225 times

Last updated: Jan 23