• Content count

  • Joined

  • Last visited

Community Reputation

0 Neutral

About StuweXY

  • Rank

Robot Information

  • Company Name
    Reutlingen University

Recent Profile Visitors

The recent visitors block is disabled and is not being shown to other users.

  1. StuweXY

    Camera specifications

    Hi, is there a documentation of the Cognex Camera? All I could find was this but I need values like the focal length or the sensor size. Does anyone know something about that? Best regards
  2. StuweXY

    Extended IK Service Example

    Hi guys, I tried to extend the IK Service Example by orienting myself on point #4 of the tutorial to move the robot to the found solution. Everything works, except the moving part. The set_joint_positions function and as well as the move_to_joint_position function return an error AttributeError: 'str' object has no attribute 'set_joint_positions'. I don't see my mistake because in the documentation it says for the function parameter position: positions (dict({str:float})) - joint_name:angle command, and also the tutorial does it like that. So why doesn't it work? Here is my code: #!/usr/bin/env python import pprint import rospy import intera_interface import intera_external_devices from intera_interface import CHECK_VERSION from std_msgs.msg import Header from sensor_msgs.msg import JointState from geometry_msgs.msg import ( PoseStamped, Pose, Point, Quaternion, ) from intera_core_msgs.srv import ( SolvePositionIK, SolvePositionIKRequest, ) class PickAndPlace(object): # Register clean shutdown def clean_shutdown(): print("\nExiting example.") return True def __init__(self): # Verify limb parameters print("Validating limbs...") rp = intera_interface.RobotParams() valid_limbs = rp.get_limb_names() if not valid_limbs: rp.log_message(("Cannot detect any limb parameters on this robot. " "Exiting."), "ERROR") return # Verify robot is enabled print("Getting robot state... ") rs = intera_interface.RobotEnable() print("Enabling robot... ") rs.enable() print("Done.") #Move in neutral position print("Moving to neutral position... ") limb = intera_interface.Limb('right') #limb.move_to_neutral() print("Done.") def doit(self, limb = "right"): # Initialising IK services ns = "ExternalTools/" + limb + "/PositionKinematicsNode/IKService" iksvc = rospy.ServiceProxy(ns, SolvePositionIK) ikreq = SolvePositionIKRequest() hdr = Header(, frame_id='base') # Defining a new pose poses = { 'right': PoseStamped( header=hdr, pose=Pose( position=Point( x=0.450628752997, y=0.161615832271, z=0.217447307078, ), orientation=Quaternion( x=0.704020578925, y=0.710172716916, z=0.00244101361829, w=0.00194372088834, ), ), ), } # Add desired pose for inverse kinematics ikreq.pose_stamp.append(poses[limb]) # Request inverse kinematics from base to "right_hand" link ikreq.tip_names.append('right_hand') try: rospy.wait_for_service(ns, 5.0) # resp enthaelt momentane joint positions resp = iksvc(ikreq) except (rospy.ServiceException, rospy.ROSException), e: rospy.logerr("Service call failed: %s" % (e,)) return False # Check if result valid, and type of seed ultimately used to get solution if(resp.result_type[0] > 0): # Seed is optional, default mode: each strategy will be used seed_str = { ikreq.SEED_USER: 'User Provided Seed', ikreq.SEED_CURRENT: 'Current Joint Angles', ikreq.SEED_NS_MAP: 'Nullspace Setpoints', }.get(resp.result_type[0], 'None') rospy.loginfo("SUCCESS\nValid Joint Solution Found from Seed Type:\n%s" %(seed_str,)) # Format solution into Limb API-compatible dictionary limb_joints = dict(zip(resp.joints[0].name, resp.joints[0].position)) #-print("Joints: " + str(tuple(resp.joints[0].position))) # Formatted print of joints (instead of rospy.loginfo()) print("\nIK Joint Solution:") pp = pprint.PrettyPrinter(indent=4) pp.pprint(limb_joints) #rospy.loginfo("\nIK Joint Solution:\n%s", limb_joints) rospy.loginfo("------------------") else: rospy.logerr("INVALID POSE - No Valid Joint Solution Found.") rospy.logerr("Result Error %d", resp.result_type[0]) return False while not rospy.is_shutdown(): print("Moving robot to joint solution...") limb.set_joint_positions(limb_joints) rospy.sleep(0.01) return True if __name__ == '__main__': # Init Node for communication with Master rospy.init_node("PickAndPlace", anonymous=True) # Calling init pickandplace = PickAndPlace() print("--- Initialisation complete. ---") print("Calling doit()...") pickandplace.doit() print("--- Task complete. ---")
  3. Hi Sina, I stumbled upon this while learning tf. Maybe it can solve your problem.
  4. StuweXY

    Programming Sawyer

    Small update to one of my problems: I got the Python file executable; didn't realize there is a console command necessary. And for clarification what the actual problem is I think: the workflow. I once programmed an ABB robot with their software. And what usually have had to be done was at first loading your objects (boxes, CAD data, ...) into a visualizer, import the necessary points into your code and then simply work with them. This kind of structure is missing here or at least I don't see it. I hope someone can help me with this issue.
  5. StuweXY

    Programming Sawyer

    Hello everyone, my goal is to be able to program Sawyer with Python. It would be ideal if I could run a simulation of my program first to see if everything is correct. Therefor I familiarized myself with some of the provided example programs and did the MoveIt-Tutorial and also looked a bit further into RVIZ. My problem now is, I checked out the RVIZ tutorial here but the commands have not much to do with the ones used in the examples. So my questions are: Is it better to orient myself on the example programs than on the general ros stuff? And how can I test my program, like sending it into RVIZ? I already wrote a small one for initialisation, copied it to the examples and tried running it, but I got told it wasn't an executable?! Best regards
  6. StuweXY

    Unable to ping Sawyer

    Hi Don, yes, I use the port on the outside. Meanwhile I tried to connect via Router and this also doesn't work. I now think it has probably something to do with my Virtual Machine, because I am able to connect to the robot using Intera and Chrome in MS Windows (which means the cable should be fine).
  7. StuweXY

    Unable to ping Sawyer

    Hi Ian, I want to use Direct Connect. When I follow the tutorial the terminal only shows my workstation (multiple times) after entering $ avahi-browse -a -r but I don't see the local hostname of the robot.
  8. StuweXY

    Unable to ping Sawyer

    Hi, I've never worked with Ubuntu and now I am kinda lost what to do. Before describing the problem I'll tell you what I already did: 1) installing Ubuntu 14.04.05 as VM 2) Setting up ROS, the tutorials work 3) I used and to connect directly to Sawyer. In the first tutorial it fails at the commando "rostopic list" (ERROR: Unable to communicate with master!) and in the second tutorial I can't ping the robot. env | grep ROS returns i.a. ROS_MASTER_URI=http://<serial number>.local:11311 and ROS_HOSTNAME my computer. I can also ping my computer, but when I try to ping Sawyer with ping <Serial number>.local it returns "unknown host". A colleague has Sawyer connected via a router and it works fine. So where is the problem with direct connection?