ROS Resources: Documentation | Support | Discussion Forum | Index | Service Status | ros @ Robotics Stack Exchange
Ask Your Question

Revision history [back]

You'll need to completely change the way you're commanding the robot arm to create smooth motion. At the moment you're planing then executing discrete paths to move from one step at the time, so the arm movement will be rough and jerky. You want to directly control the velocity of the joints of the robot instead.

The moveit interface that can control this as far as I know is only available in the C++ API, so I don't know if you'll be able to do this in python. Someone more knowledgeable about moveit may correct me here. If you're familiar with C++ then this will be an option for you.

You control the velocity of the arms joints using the moveit::core::RobotState object. The setJointVelocies method to can be used to set the velocity of a particular joint as shown below:

JointModel *joint = myRobotState.getJointModel("<joint name>");
double jointVelocity = 0.1; // velocity in radians per second
myRobotState.setJointVelocities(joint, &jointVelocity);

Using these methods you'd set a positive velocity if butons[0] and axes[6] are 1 and a zero velocity if they're not, this will produce the behaviour you want. I appreciate this will involve a large reworking of your code though.