Hey there,
I want to change the base position.
In this given example, I want to attach my robot upside facing towards down. I there any way to do it?
I have tried changing the urdf file, but the robot orientation and linking all joints 180 degrees was causing the problem. Any easy idea to achieve this type of result?
<?xml version="1.0" ?>
<!-- =================================================================================== -->
<!-- | This document was autogenerated by xacro from kr16_2.xacro | -->
<!-- | EDITING THIS FILE BY HAND IS NOT RECOMMENDED | -->
<!-- =================================================================================== -->
<!--Generates a urdf from the macro in kr16_2_macro.xacro -->
<robot name="kuka_kr16_2" xmlns:xacro="http://wiki.ros.org/xacro">
<!-- LINKS -->
<!-- base link -->
<link name="base_link">
<inertial>
<origin rpy="3.14 0 0" xyz="0 0 2.35"/>
<mass value="2"/>
<inertia ixx="0.01" ixy="0" ixz="0" iyy="0.01" iyz="0" izz="0.01"/>
</inertial>
<visual>
<origin rpy="3.14 0 0" xyz="0 0 2.35"/>
<geometry>
<mesh filename="package://kuka_kr16_support/meshes/kr16_2/visual/base_link.dae"/>
</geometry>
</visual>
<collision>
<origin rpy="3.14 0 0" xyz="0 0 2.35"/>
<geometry>
<mesh filename="package://kuka_kr16_support/meshes/kr16_2/collision/base_link.stl"/>
</geometry>
</collision>
</link>
<!-- link 1 (A1) -->
<link name="link_1">
<inertial>
<origin rpy="0 0 0" xyz="0 0 0"/>
<mass value="2"/>
<inertia ixx="0.01" ixy="0" ixz="0" iyy="0.01" iyz="0" izz="0.01"/>
</inertial>
<visual>
<origin rpy="0 0 0" xyz="0 0 0"/>
<geometry>
<mesh filename="package://kuka_kr16_support/meshes/kr16_2/visual/link_1.dae"/>
</geometry>
</visual>
<collision>
<origin rpy="0 0 0" xyz="0 0 0"/>
<geometry>
<mesh filename="package://kuka_kr16_support/meshes/kr16_2/collision/link_1.stl"/>
</geometry>
</collision>
</link>
<!-- link 2 -->
<link name="link_2">
<inertial>
<origin rpy="0 0 0" xyz="0 0 0"/>
<mass value="2"/>
<inertia ixx="0.01" ixy="0" ixz="0" iyy="0.01" iyz="0" izz="0.01"/>
</inertial>
<visual>
<origin rpy="0 0 0" xyz="0 0 0"/>
<geometry>
<mesh filename="package://kuka_kr16_support/meshes/kr16_2/visual/link_2.dae"/>
</geometry>
</visual>
<collision>
<origin rpy="0 0 0" xyz="0 0 0"/>
<geometry>
<mesh filename="package://kuka_kr16_support/meshes/kr16_2/collision/link_2.stl"/>
</geometry>
</collision>
</link>
<!-- link 3 -->
<link name="link_3">
<inertial>
<origin rpy="0 0 0" xyz="0 0 0"/>
<mass value="2"/>
<inertia ixx="0.01" ixy="0" ixz="0" iyy="0.01" iyz="0" izz="0.01"/>
</inertial>
<visual>
<origin rpy="0 0 0" xyz="0 0 0"/>
<geometry>
<mesh filename="package://kuka_kr16_support/meshes/kr16_2/visual/link_3.dae"/>
</geometry>
</visual>
<collision>
<origin rpy="0 0 0" xyz="0 0 0"/>
<geometry>
<mesh filename="package://kuka_kr16_support/meshes/kr16_2/collision/link_3.stl"/>
</geometry>
</collision>
</link>
<!-- link 4 -->
<link name="link_4">
<inertial>
<origin rpy="0 0 0" xyz="0 0 0"/>
<mass value="2"/>
<inertia ixx="0.01" ixy="0" ixz="0" iyy="0.01" iyz="0" izz="0.01"/>
</inertial>
<visual>
<origin rpy="0 0 0" xyz="0 0 0"/>
<geometry>
<mesh filename="package://kuka_kr16_support/meshes/kr16_2/visual/link_4.dae"/>
</geometry>
</visual>
<collision>
<origin rpy="0 0 0" xyz="0 0 0"/>
<geometry>
<mesh filename="package://kuka_kr16_support/meshes/kr16_2/collision/link_4.stl"/>
</geometry>
</collision>
</link>
<!-- link 5 -->
<link name="link_5">
<inertial>
<origin rpy="0 0 0" xyz="0 0 0"/>
<mass value="2"/>
<inertia ixx="0.01" ixy="0" ixz="0" iyy="0.01" iyz="0" izz="0.01"/>
</inertial>
<visual>
<origin rpy="0 0 0" xyz="0 0 0"/>
<geometry>
<mesh filename="package://kuka_kr16_support/meshes/kr16_2/visual/link_5.dae"/>
</geometry>
</visual>
<collision>
<origin rpy="0 0 0" xyz="0 0 0"/>
<geometry>
<mesh filename="package://kuka_kr16_support/meshes/kr16_2/collision/link_5.stl"/>
</geometry>
</collision>
</link>
<!-- link 6 -->
<link name="link_6">
<inertial>
<origin rpy="0 0 0" xyz="0 0 0"/>
<mass value="2"/>
<inertia ixx="0.01" ixy="0" ixz="0" iyy="0.01" iyz="0" izz="0.01"/>
</inertial>
<visual>
<origin rpy="0 0 0" xyz="0 0 0"/>
<geometry>
<mesh filename="package://kuka_kr16_support/meshes/kr16_2/visual/link_6.dae"/>
</geometry>
</visual>
<collision>
<origin rpy="0 0 0" xyz="0 0 0"/>
<geometry>
<mesh filename="package://kuka_kr16_support/meshes/kr16_2/collision/link_6.stl"/>
</geometry>
</collision>
</link>
<!-- tool 0 -->
<!-- This frame corresponds to the $FLANGE coordinate system in KUKA KRC controllers. -->
<link name="tool0"/>
<!-- END LINKS -->
<!-- JOINTS -->
<!-- joint 1 (A1) -->
<joint name="joint_a1" type="revolute">
<origin rpy="3.14 0 0" xyz="0 0 1.675"/>
<parent link="base_link"/>
<child link="link_1"/>
<axis xyz="0 0 1.35"/>
<limit effort="0" lower="-3.22885911619" upper="3.22885911619" velocity="2.72271363311"/>
</joint>
<!-- joint 2 (A2) -->
<joint name="joint_a2" type="revolute">
<origin rpy="0 0 0" xyz="0.26 0 0"/>
<parent link="link_1"/>
<child link="link_2"/>
<axis xyz="0 1 0"/>
<limit effort="0" lower="-2.70526034059" upper="0.610865238198" velocity="2.72271363311"/>
</joint>
<!-- joint 3 (A3) -->
<joint name="joint_a3" type="revolute">
<origin rpy="0 0 0" xyz="0.68 0 0"/>
<parent link="link_2"/>
<child link="link_3"/>
<axis xyz="0 1 0"/>
<limit effort="0" lower="-2.26892802759" upper="2.68780704807" velocity="2.72271363311"/>
</joint>
<!-- joint 4 (A4) -->
<joint name="joint_a4" type="revolute">
<origin rpy="0 0 0" xyz="0.67 0 -0.035"/>
<parent link="link_3"/>
<child link="link_4"/>
<axis xyz="-1 0 0"/>
<limit effort="0" lower="-6.10865238198" upper="6.10865238198" velocity="5.75958653158"/>
</joint>
<!-- joint 5 (A5) -->
<joint name="joint_a5" type="revolute">
<origin rpy="0 0 0" xyz="0 0 0"/>
<parent link="link_4"/>
<child link="link_5"/>
<axis xyz="0 1 0"/>
<limit effort="0" lower="-2.26892802759" upper="2.26892802759" velocity="5.75958653158"/>
</joint>
<!-- joint 6 (A6) -->
<joint name="joint_a6" type="revolute">
<origin rpy="0 0 0" xyz="0 0 0"/>
<parent link="link_5"/>
<child link="link_6"/>
<axis xyz="-1 0 0"/>
<limit effort="0" lower="-6.10865238198" upper="6.10865238198" velocity="10.7337748998"/>
</joint>
<!-- tool frame - fixed frame -->
<joint name="joint_a6-tool0" type="fixed">
<parent link="link_6"/>
<child link="tool0"/>
<origin rpy="0 1.57079632679 0" xyz="0.158 0 0"/>
</joint>
<!-- END JOINTS -->
<!-- ROS base_link to KUKA $ROBROOT coordinate system transform -->
<link name="base"/>
<joint name="base_link-base" type="fixed">
<origin rpy="3.14 0 0" xyz="0 0 2.35"/>
<parent link="base_link"/>
<child link="base"/>
</joint>
</robot>
I have just changed rpy, xyz of base_link and rpy, xyz , and child axis xyz of joint_a1
Solved but confused with the base_link. It should be Either it should be on the top near a base location?
Thanks.
Originally posted by Ranjit Kathiriya on ROS Answers with karma: 1622 on 2021-02-17
Post score: 1
Original comments
Comment by fvd on 2021-02-17:
Please show how you changed the URDF file and what error you received.
Comment by gvdhoorn on 2021-02-17:
Apart from the fact you're using a KUKA, this reads like a duplicate of #q321902.
If you agree, please close your question as such.
Edit: it might be good to change the title of your question to "I want to attach my robot upside-down". The current title asks about a possible solution, which is typically regarded as an xy-problem.
Comment by gvdhoorn on 2021-02-17:
Please post updates by appending to in your original question text. Do not use comments for this.
Use the edit
button/link under your original post to update it.
Comment by Ranjit Kathiriya on 2021-02-17:
I am sorry was not knowing that we can edit the original question post. I am not able to delete this comment. I am getting 10 minutes posting error.