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

How do I manually control/jog a robot arm with MoveIt using ROSPY?

asked 2021-04-13 14:31:39 -0500

DauntingROS gravatar image

Problem

I want to be able to move a custom robot arm with MoveIt handling the kinematics of the arm with live movement as opposed to planning followed by execution. I hope to do this with ROSPY through publishing to a topic or a service in Python 2.7.17 on ROS 1 Melodic.

Current Setup

I currently can receive information about a spotted object, and I can have the physical robot replicate the movements published from the joint state publisher.

These are the 5 nodes of my system where the second from the top is what I am trying to find a solution for now.

  • One node which gives me the position of an object relative to the center of the cameras view through a topic (working)
  • (What this question is about) A node which moves the robot end effector to the object spotted. (Not Working)
  • One node which is my robots custom moveIt URDF (working)
  • One node which is a translation node I have written to take the data from joint_state and translate it to servo movement with no feedback (working)
  • One node which communicates with the arms simple RC servos over I2C through a pca9685 board (working)

More Detail

I have the relative position of an object live, and wish to move the arm until the camera is centered on the object.

I for the life of me cannot figure out how I would actually go about doing that.

All I can find is related to planning a move rather than perhaps, setting a velocity and or position for the end effector/position.

The closest I've found relates to something called jog_arm from a long time ago, which has been said to be integrated somewhere in a future version. I can't find it though, so rather than spend an even more embarrassingly long time trying to figure it out I am posting this with the hopes that someone understands what I'm trying to do and can give me the search term/documentation link/api page I need to figure this out or maybe the answer is just that the thing Im looking for somehow doesn't exist.

Environment/Setup Stats:

  • Platform: Jetson Nano 2GB, with Latest jetpack (Ubuntu 18.04 base)
  • ROS Version: Melodic
  • Python Version: Python 2.7.17
  • MoveIt: Version for Melodic
edit retag flag offensive close merge delete

Comments

The closest I've found relates to something called jog_arm from a long time ago, which has been said to be integrated somewhere in a future version. I can't find it though [..]

it was renamed to Servo and is integrated into MoveIt.

See MoveIt: Realtime Arm Servoing for the Noetic version of the documentation/tutorial.

Note: I've posted this as a comment instead of an answer as I'm not sure what your question is.

If you're just asking for the current documentation/tutorials on what used to be called JogArm, then I believe the link above should be the answer. In that case, I'll convert this comment into an answer.

gvdhoorn gravatar image gvdhoorn  ( 2021-04-13 14:39:16 -0500 )edit

@gvdhoorn

I think this looks like maybe what I'm looking for yet setting it up seems like a nightmare. Basically since the moment you posted this I've been trying to figure it out to see if it was the answer 😥

Maybe for someone else this will make more sense, but basically nothing from the example seems immediately applicable. I don't have any moveit_servo, and Im not even sure exactly what needs to be launched for this to work even in the event I did.

This is starting to feel impossible to tackle without having taken a course on the subject and having deep knowledge of the system underneath. Its probably made harder due to the awkward way Im using regular hobby motors and joint_state_publisher rather than a proper robot controller.

Im also not certain it even exists in Melodic because the link given is for noetic?! but ...(more)

DauntingROS gravatar image DauntingROS  ( 2021-04-13 17:01:34 -0500 )edit

1 Answer

Sort by » oldest newest most voted
3

answered 2021-04-13 19:54:43 -0500

JeremieBourque gravatar image

If you want to be able to move the end effector in real time with something like a joystick or gamepad, then your best bet would be to use moveit_servo, just like gvdhoom suggested. It does take some setting up and I'll admit that the documentation is lacking in explanation on how to set it up, but I did it recently for a 4DoF simulated arm which you can find here in the branch named "experimentations". You can try it by cloning the repo into your catkin workspace and following the instructions in the readme. And yes, it does work in Melodic which is the version I am using and all the required moveit pacakges can be installed with apt.

"open_manipulator_moveit_config" is where all of the moveit files are located. The ones of interest for setting up moveit_servo are:

In open_manipulator_simulated_config.yaml you'll need to change move_group_name, planning_frame, robot_link_command_frame and ee_frame_name to your robot's values. You can also change command_out_type to the controller type of your robot. You can also look at the other parameters but I think these should be enough to get started.

In ros_controllers.yaml you need to create a position_controllers/JointGroupPositionController controller just like I did but with the right joints

ros_controllers.launch is where the controllers are spawned or loaded

moveit_servo.launch is where the servo server is launched, which is what will enable you to send twist commands to the robot.

I'm definitely not an expert in MoveIt so it's possible that I am not using the best practices, but it does work (expect for moving the arm in the Y axis but that's another problem). Hope this helps.

edit flag offensive delete link more

Comments

I'll admit that the documentation is lacking in explanation on how to set it up, but I did it recently

reading things like this makes me a little sad.

If you've identified parts which you feel are incomplete or underdocumented, have you reported those, and ideally, extended the documentation and contributed that?

Without people like you, who found things lacking and then decided to do something about it, it's hard to know what's missing for someone just starting out.

gvdhoorn gravatar image gvdhoorn  ( 2021-04-14 02:18:26 -0500 )edit

No I haven't contributed to the documentation. I am new to MoveIt so I am not yet conffident enough in my knowledge to contribute, but I could definetly do that some time down the line.

JeremieBourque gravatar image JeremieBourque  ( 2021-04-14 08:37:43 -0500 )edit

This is going to sound strange, but your (perceived) inexperience is your great strength.

Large parts of the documentation is written exactly for people who are new to things. But often written by people who are not new to those things.

So your fresh view on things is almost a superpower.

If you wait until you are more comfortable, you've lost that perspective.

There is no minimum level of knowledge or experience required before contributing anything.

Trust me.

gvdhoorn gravatar image gvdhoorn  ( 2021-04-14 09:08:46 -0500 )edit

Give in.

Write documentation.

fvd gravatar image fvd  ( 2021-04-14 09:49:25 -0500 )edit

In all seriousness, I was shy about changing (or even noting down) parts of the tutorial that I found lacking when I started, and by the time I felt comfortable I had forgotten all of the parts that gave me so much trouble. Years later there are PRs that make me wonder why I didn't change the part the first time I saw that.

Even just noting publicly that a particular section felt inadequate can be helpful. Adding to the documentation yourself is a gold star sticker with glitter.

fvd gravatar image fvd  ( 2021-04-14 09:54:42 -0500 )edit

Question Tools

1 follower

Stats

Asked: 2021-04-13 14:31:39 -0500

Seen: 1,076 times

Last updated: Apr 13 '21