Gazebo | Ignition | Community
Ask Your Question
0

Inverse kinematics for Atlas Arm?

asked 2013-06-14 12:13:44 -0500

Prashant gravatar image

updated 2013-06-14 12:25:51 -0500

Hi All. I am trying to find out the Inverse Kinematic solution for the Atlas Arm. I am trying to use the 'arm_kinematics' package for this. The steps I used for this are as follows:

I entered the following commands in seperate terminals:

  1. roslaunch urdf_tutorial display.launch model:=atlas_sandia_hands.urdf

  2. roslaunch atlas_utils atlas_sandia_hands.launch

In a separate terminal I entered the following commands:

  1. rosparam set urdf_xml robot_description
  2. rosparam set robot_description atlas_sandia_hands.urdf
  3. rosparam set arm_kinematics/root_name utorso
  4. rosparam set arm_kinematics/tip_name l_hand
  5. rosparam set maxIterations 1000
  6. rosrun arm_kinematics arm_kinematics

Then I wrote a python script for finding out the IK solution. I tried following the tutorial for PR2 arm inverse kinematics. This is what I had:

! /usr/bin/env python

import roslib roslib.loadmanifest('tutorial_atlas_control') roslib.loadmanifest('geometry_msgs') roslib.load_manifest('kinematics_msgs')

import rospy, yaml, sys from atlas_msgs.msg import AtlasCommand from sensor_msgs.msg import JointState from std_msgs.msg import * from geometry_msgs.msg import * from kinematics_msgs.srv import * from arm_navigation_msgs.srv import *

class findik:

def get_ik(self, x, y, z):
    rospy.init_node('find_ik')

    self.ik_info = '/arm_kinematics/get_ik_solver_info'    

    print "waiting for ik service"
    rospy.wait_for_service(self.ik_info) 
    self.ik_info_service = rospy.ServiceProxy(self.ik_info, GetKinematicSolverInfo)
    self.ik_info_service.joint_names = ["l_arm_usy",
                                        "l_arm_shx",
                                        "l_arm_ely",
                                        "l_arm_elx",
                                        "l_arm_uwy",
                                        "l_arm_mwx"]
    self.ik_info_service.joint_names = ["utorso",
                                        "l_clav",
                                        "l_scap",
                                        "l_uarm",
                                        "l_larm",
                                        "l_farm",
                                        "l_hand"]


    self.ik_info_req = GetKinematicSolverInfoRequest()
    self.ik_info_res = self.ik_info_service.call(self.ik_info_req)    

    self.ik_service = rospy.ServiceProxy('arm_kinematics/get_ik', GetPositionIK, True)

    self.ik_req = GetPositionIKRequest()
    self.ik_req.timeout = rospy.Duration(5.0)
    self.ik_req.ik_request.ik_link_name = 'l_hand'
    self.ik_req.ik_request.ik_seed_state.joint_state.name = self.ik_info_res.kinematic_solver_info.joint_names
    self.ik_req.ik_request.ik_seed_state.joint_state.position = [0]*6

    self.ps = PoseStamped()
    self.ps.header.stamp = rospy.Time(0)
    self.ps.header.frame_id = 'pelvis'
    self.ps.pose.position.x = x
    self.ps.pose.position.y = y
    self.ps.pose.position.z = z

    self.ps.pose.orientation.x = 0
    self.ps.pose.orientation.y = 0
    self.ps.pose.orientation.z = 0
    self.ps.pose.orientation.w = 1.0

    self.ik_req.ik_request.pose_stamped = self.ps        

    self.ik_res = self.ik_service.call(self.ik_req)

if __name__ == '__main__': ik = findik() ik.get_ik(0.55, -0.15, 1.2)

However the command "self.ik_res = self.ik_service.call(self.ik_req)" would result in rospy exception and would stop the "arm_kinematics" node in the other terminal.

Has any one tried finding IK for Atlas. What Package did you use. If you used "arm_kinematics" did you run into similar problem?? Please let me know. I am using ros Fuerte, Gazebo 1.8.2 and drcsim 2.6.6.1 in ubuntu 12.04.

Any help will be highly appreciated. Thanks.

edit retag flag offensive close merge delete

2 Answers

Sort by ยป oldest newest most voted
0

answered 2013-06-18 00:33:59 -0500

nkoenig gravatar image

I recommend using MoveIt!

edit flag offensive delete link more

Comments

@nkoenig Thanks for the reply. I have one question though. MoveIt seems to be better as it is going to replace arm_navigation. However It is not available for fuerte!! And drcsim comes along with fuerte. So I think I should either try to run drcsim with groovy or run moveit on fuerte. Which one do you think is better option??

Prashant gravatar imagePrashant ( 2013-06-18 13:55:09 -0500 )edit

Try to run moveit with fuerte

nkoenig gravatar imagenkoenig ( 2013-07-23 18:36:52 -0500 )edit
0

answered 2013-06-15 10:18:04 -0500

Francisco gravatar image

I have tried the arm_kinematics package but after a while it wasn't enough for my application.

However I can recommend you the arm_navigation stack and specifically the Planning Description Configuration Wizard.

For the atlas_sandia_hands it is:

$ roslaunch planning_environment planning_description_configuration_wizard.launch urdf_package:=atlas_sandia_hands urdf_path:=atlas_sandia_hands.urdf

I think this tutorial will be a good starting point for you.

After that, you may want to continue with the rest of the arm_navigation tutorials.

You may think that this alternative is complex if you only want the inverse kinematics but I think it is worth the shot.

Hope this help

edit flag offensive delete link more

Comments

Thanks for the reply. I'll give it a try.

Prashant gravatar imagePrashant ( 2013-06-16 13:56:31 -0500 )edit

@Francisco I tried following your instructions. But when I type the following command in the terminal "roslaunch atlas_arm_navigation atlas_arm_navigation.launch" following message keeps coming on the screen " waitForService: Service [/register_planning_scene] has not been advertised, waiting... , Waiting for robot state ..., Waiting for joint state ..., Waiting for environment server planning scene registration service /register_planning_scene". I don't know what to do next??

Prashant gravatar imagePrashant ( 2013-06-19 14:18:59 -0500 )edit

Question Tools

Stats

Asked: 2013-06-14 12:13:44 -0500

Seen: 1,309 times

Last updated: Jun 18 '13