Rosanswers logo

I've been working with moveit for the past two weeks. However, I am trying to do visual servoing with my robot, but I cannot find any example about moveit with visual servoing. I know that using moveit with API is always plan for the next movement which delays the process.

I try to use my visual servoing with planning in python I get really slow running (2Hz). I change to c++ and I get faster progress which is (10Hz). 10Hz is fine but still, the planning is not required in this process, especially the end_effector move by the small change from the old position.

is there any way I can stop the planning, or just generating the joint angle from the position so I can start with the current position and then add the difference.

I've been thinking about using IK_service but I am not sure if it will be fast enough to do visual servo.

Originally posted by ahmohamed on ROS Answers with karma: 1 on 2017-07-08

Post score: 0

Original comments

Comment by Anukriti on 2021-12-01:
hey, are you doing position based visual servoing or image based visual servoing?


1 Answer 1


Rosanswers logo

If you already know where you are going -- and are not interested in any of the collision avoidance and other planning features of MoveIt -- I would not use MoveIt, but just host an IK plugin in your own node. Then use that together with an inverse Jacobian or similiar approach to arrive at new joint space targets every cycle. Then send that to your driver.

If you have a ros_control based driver, or one that implements trajectory replacement correctly, you could even use that.

Originally posted by gvdhoorn with karma: 86574 on 2017-07-09

This answer was ACCEPTED on the original site

Post score: 1

Original comments

Comment by ahmohamed on 2017-07-09:
The issue I have is I am not able to generate the IK for my arm which is 7DOF. I've been trying to generate it using IKfast but I cannot get the IK as always get an error. I thought if I can use moveit IK without planning could help but I don't know from I can start.

Comment by gvdhoorn on 2017-07-09:
MoveIt will use whatever IK plugin you have configured. If you don't have an IKFast plugin for your robot, use Trac IK or KDL.

As for generating an IKFast plugin: #q263925. That's for 4dof though. You'll have to tweak the openrave.py command line a bit with > 6 dofs (free joint etc).

Comment by gvdhoorn on 2017-07-09:
To clarify: both Trac IK and KDL can be used perfectly fine without MoveIt.

Comment by v4hn on 2017-07-10:
Also "with MoveIt" is quite broad. You can definitely write your own servoing node that instantiates a moveit::core::RobotState and calls setFromIK on it. That way you can even do collision checking internally if your cycle rate allows for it, by instantiating a PlanningScene too.

Comment by gvdhoorn on 2017-07-10:
Sure, that is definitely possible, and we even do it in one of our projects here. Wasn't sure whether to suggest that at this stage, so I left it out.

Comment by ahmohamed on 2017-07-10:
thank you guys for your advice. So far I am trying to use IK_service to do the job. @gvdhoom I will appreciate if you can give me more details.

Comment by v4hn on 2017-07-11:
I suppose you mean the compute_ik ros service. This is a bad idea indeed. Have a look at http://docs.ros.org/kinetic/api/moveit_tutorials/html/doc/pr2_tutorials/kinematics/src/doc/kinematic_model_tutorial.html#inverse-kinematics instead.

Comment by gvdhoorn on 2017-07-11:
@v4hn: I agree. @ahmohamed: the service is not a good idea. Use what @v4hn linked to or load the IK plugins directly.


Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.