Quantcast
Channel: ROS Answers: Open Source Q&A Forum - RSS feed
Viewing all articles
Browse latest Browse all 1441

MoveIt: how to actuate individual joints that do not form a chain?

$
0
0
Hi, I'm working on a project at my university in which we are designing and simulating an industrial robot system. We have created a URDF file that contains the robot system, as well as the platform it sits on. There are also two movable caterpillar tracks on this platform, which we need to be able to control programmatically. We've created a MoveIt configuration for the robotic arm that the robot system consists of, which works properly. To give you a bit of an image (literally) of how the system and the tracks look like: ![overview](/upfiles/15155368113219135.png) ### Question: My problem arises when I want to control the two movable tracks, which each consist of just a single joint. The relevant parts of the robot's URDF are included below; for brevity, I left out the rest. I want to be able to control the individual joints `track2_joint` and `track3_joint` from Python, but I have not yet been able to find out how... ### My attempts I've tried to make a planning group with just `track2_joint` in it without selecting a kinematics solver, hoping that I would be able to use `group.set_joint_value_target` in order to get easy control over the track. The MoveIt Setup Assistant allowed me to do so, so I tried it out in some code, here's the relevant snippet: robot = moveit_commander.RobotCommander() joint = robot.get_joint('track2_joint') moveGroup = moveit_commander.MoveGroupCommander('Track2') currentJointValues = moveGroup.get_current_joint_values() print("Min bound: " + str(joint.min_bound())) print("Value: " + str(currentJointValues)) print("Max bound: " + str(joint.max_bound())) currentJointValues[0] += pi * 1/3 moveGroup.set_joint_value_target(currentJointValues) moveGroup.plan() This seemed to work fine. The print statements printed the correct values and `plan` caused the correct rotation to be shown in RViz. But when I replaced `plan()` with `go()`, I got the following message in the console in which I launched the test: `[ INFO] [1515523071.981027951]: ABORTED: Solution found but controller failed during execution` The following appeared in the console in which I launched the planning execution launch file: [ INFO] [1515523071.563018404]: Combined planning and execution request received for MoveGroup action. Forwarding to planning and execution pipeline. [ INFO] [1515523071.563289980]: Planning attempt 1 of at most 1 Debug: Starting goal sampling thread Debug: Waiting for space information to be set up before the sampling thread can begin computation... [ INFO] [1515523071.564900737]: Planner configuration 'Track2' will use planner 'geometric::RRTConnect'. Additional configuration parameters will be set when the planner is constructed. Debug: RRTConnect: Planner range detected to be 1.256640 Info: RRTConnect: Starting planning with 1 states already in datastructure Debug: RRTConnect: Waiting for goal region samples ... Debug: Beginning sampling thread computation Debug: Stopped goal sampling thread after 10 sampling attempts Debug: RRTConnect: Waited 0.010084 seconds for the first goal sample. Info: RRTConnect: Created 5 states (2 start + 3 goal) Info: Solution found in 0.012115 seconds Info: SimpleSetup: Path simplification took 0.001880 seconds and changed from 4 to 17 states [ERROR] [1515523071.662697635]: Joint trajectory action failing on invalid joints [ WARN] [1515523071.663024659]: Controller failed with error code INVALID_JOINTS [ WARN] [1515523071.663147109]: Controller handle reports status FAILED I suspected it was most likely due to the fact that I had not specified a kinematic solver, so I thought I'd just select the default KDLKinematicsPlugin, but that gave me the following error while launching the planning execution file: [ERROR] [1515523523.939177828]: Group 'Track2' is not a chain [ERROR] [1515523523.939227171]: Kinematics solver of type 'kdl_kinematics_plugin/KDLKinematicsPlugin' could not be initialized for group 'Track2' [ERROR] [1515523523.940096000]: Kinematics solver could not be instantiated for joint group Track2. Defining the planning group 'Track2' as a chain from `base_link` to `track2_link` was not able to solve that either. I have been scouring the internet to find another way in which I can actuate a single joint, but I cannot seem to find any good way. [This question](https://answers.ros.org/question/277370/how-to-move-specific-joint-only-using-moveit/) suggests setting up a "JointModelGroup" in the SRDF for each single joint, which seems to correspond with just creating a planning group in the setup assistant like I tried earlier. The answer to another question I found suggested the same thing. I've also seen several suggestions towards the `RobotState` class, but that does not exist in Python. I believe its Python equivalent is RobotCommander though, which is where I can get the joint from as shown in my earlier snippet. The joint object that is returned apparently also has a `move` method, but that just tries to retrieve the group it is in, set a joint value target on that and then call its `go()` method, which is the very thing that failed earlier. Relevant parts of the URDF: My `controllers.yaml` file: controller_list: - name: "" action_ns: joint_trajectory_action type: FollowJointTrajectory joints: [cart1_joint, main1_joint, elbow1_joint, forearm1_joint, wrist1_joint, gripper1_joint] So, how do I get this done? Is it still possible with MoveIt planning groups, or is there another way in which this should be done? I also need this in order to be able to control the different parts of the gripper at the end of the arm.

Viewing all articles
Browse latest Browse all 1441

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>