how to make my model walk on rviz?
Hi, I am new to ROS and Rviz and I am trying to make a humanoid model using urdf that can walk on rviz changing joint angles. Before coding, I wanted to make the model walk setting manually the angles on Rviz and doing so I realized that my base is wrong. To walk I imagine that I have to set my base in a imaginary ground, where I can stay standing using only one foot, so that the other can change the place its foot is standing, but What is happening is very different than that. Can you guys help me on this? Below I have my urdf file where the base is the link called human/foot.
EDIT: When I said that my model base is wrong, I am actually not sure about it. My question here is How can I create a floor for my model to interact and walk on it? How can my model walk changing only the joint angles? Because, at the moment, he is moving his legs, but he is staying on the same place.
<?xml version="1.0" ?>
<robot name="human_model" xmlns:xacro="http://playerstage.sourceforge.net/gazebo/xmlschema/#interface">
<link name="human/pelvis">
<collision>
<origin rpy="0 0 0" xyz="0 0 -0.0405569060538"/>
<geometry>
<cylinder length="-0.0811138121076" radius="0.130553532998"/>
</geometry>
</collision>
<visual>
<origin rpy="0 0 0" xyz="0 0 -0.0405569060538"/>
<geometry>
<cylinder length="-0.0811138121076" radius="0.130553532998"/>
</geometry>
</visual>
</link>
<link name="human/spine_0">
<collision>
<origin rpy="0 0 0" xyz="0 0 0.0363124478192"/>
<geometry>
<cylinder length="0.0726248956383" radius="0.141172520845"/>
</geometry>
</collision>
<visual>
<origin rpy="0 0 0" xyz="0 0 0.0363124478192"/>
<geometry>
<cylinder length="0.0726248956383" radius="0.141172520845"/>
</geometry>
</visual>
</link>
<link name="human/spine">
<collision>
<origin rpy="0 0 0" xyz="0 0 0.137944030927"/>
<geometry>
<cylinder length="0.275888061853" radius="0.161172520845"/>
</geometry>
</collision>
<visual>
<origin rpy="0 0 0" xyz="0 0 0.137944030927"/>
<geometry>
<cylinder length="0.275888061853" radius="0.161172520845"/>
</geometry>
</visual>
</link>
<link name="human/shoulder_center">
<collision>
<origin rpy="0 0 0" xyz="0 0 0.050635057485"/>
<geometry>
<cylinder length="0.10127011497" radius="0.181172520845"/>
</geometry>
</collision>
<visual>
<origin rpy="0 0 0" xyz="0 0 0.050635057485"/>
<geometry>
<cylinder length="0.10127011497" radius="0.181172520845"/>
</geometry>
</visual>
</link>
<link name="human/neck">
<collision>
<origin rpy="0 0 0" xyz="0 0 0.102139711472"/>
<geometry>
<cylinder length="0.204279422944" radius="0.04"/>
</geometry>
</collision>
<visual>
<origin rpy="0 0 0" xyz="0 0 0.102139711472"/>
<geometry>
<cylinder length="0.204279422944" radius="0.04"/>
</geometry>
</visual>
</link>
<link name="human/head">
<collision>
<origin rpy="0 0 0" xyz="0 0 0"/>
<geometry>
<sphere radius="0.1"/>
</geometry>
</collision>
<visual>
<origin rpy="0 0 0" xyz="0 0 0"/>
<geometry>
<sphere radius="0.1"/>
</geometry>
</visual>
</link>
<joint name="hip" type="fixed">
<origin rpy="0 0 0" xyz="0 0 0"/>
<parent link="human/pelvis"/>
<child link="human/spine_0"/>
</joint>
<!-- SPINE : spherical -->
<joint name="spine_0" type="fixed">
<origin rpy="0 0 0" xyz="0 0 0.0726248956383"/>
<parent link="human/spine_0"/>
<child link="human/spine"/>
</joint>
<joint name="shoulder_center" type="fixed">
<origin rpy="0 0 0" xyz="0 0 0.275888061853"/>
<parent link="human/spine"/>
<child link="human/shoulder_center"/>
</joint>
<!-- NECK : spherical -->
<joint name="neck_0" type="fixed">
<origin rpy="0 0 0" xyz="0 0 0.10127011497"/>
<parent link="human/shoulder_center"/>
<child link="human/neck"/>
</joint>
<!-- END NECK -->
<joint name="head" type="fixed">
<origin rpy="0 0 0" xyz="0 0 0.204279422944"/>
<parent link="human/neck"/>
<child link="human/head"/>
</joint>
<link name="human/right_shoulder">
<collision>
<origin rpy="0 1.57079632679 0" xyz="0.147075804738 0 0"/>
<geometry>
<cylinder length="0.294151609476" radius="0.05"/>
</geometry>
</collision>
<visual>
<origin rpy="0 1.57079632679 0" xyz="0.147075804738 0 0"/>
<geometry>
<cylinder length="0.294151609476" radius="0.05"/>
</geometry>
</visual>
</link>
<link name="human/right_elbow">
<collision>
<origin rpy="0 1.57079632679 0" xyz="0.137074736994 0 0"/>
<geometry>
<cylinder length="0.274149473988" radius="0.025"/>
</geometry>
</collision>
<visual>
<origin rpy="0 1.57079632679 0" xyz="0.137074736994 0 0"/>
<geometry>
<cylinder length="0.274149473988" radius="0.025"/>
</geometry>
</visual>
</link>
<link name="human/right_wrist">
<collision>
<origin rpy="0 0 0" xyz="0.05 0 0"/>
<geometry>
<box size="0.1 0.05 .005"/>
</geometry>
</collision>
<visual>
<origin rpy="0 0 0" xyz="0.05 0 0"/>
<geometry>
<box size="0.1 0.05 .005"/>
</geometry>
</visual>
</link>
<link name="human/right_hand"/>
<!-- Joints -->
<joint name="right_arm_mount" type="fixed">
<origin rpy="0 0 -1.57079632679" xyz="0 -0.181172520845 -0.00609526854636"/>
<parent link="human/shoulder_center"/>
<child link="human/right_shoulder"/>
</joint>
<!-- END SHOULDER -->
<joint name="right_elbow_0" type="fixed">
<origin rpy="0 0 0" xyz="0.294151609476 0 0"/>
<parent link="human/right_shoulder"/>
<child link="human/right_elbow"/>
</joint>
<joint name="right_wrist_0" type="fixed">
<origin rpy="0 0 0" xyz="0.274149473988 0 0"/>
<parent link="human/right_elbow"/>
<child link="human/right_wrist"/>
</joint>
<joint name="right_hand" type="fixed">
<origin rpy="0 0 0" xyz="0.1 0 0"/>
<parent link="human/right_wrist"/>
<child link="human/right_hand"/>
</joint>
<link name="human/left_shoulder">
<collision>
<origin rpy="0 1.57079632679 0" xyz="0.147075804738 0 0"/>
<geometry>
<cylinder length="0.294151609476" radius="0.05"/>
</geometry>
</collision>
<visual>
<origin rpy="0 1.57079632679 0" xyz="0.147075804738 0 0"/>
<geometry>
<cylinder length="0.294151609476" radius="0.05"/>
</geometry>
</visual>
</link>
<link name="human/left_elbow">
<collision>
<origin rpy="0 1.57079632679 0" xyz="0.137074736994 0 0"/>
<geometry>
<cylinder length="0.274149473988" radius="0.025"/>
</geometry>
</collision>
<visual>
<origin rpy="0 1.57079632679 0" xyz="0.137074736994 0 0"/>
<geometry>
<cylinder length="0.274149473988" radius="0.025"/>
</geometry>
</visual>
</link>
<link name="human/left_wrist">
<collision>
<origin rpy="0 0 0" xyz="0.05 0 0"/>
<geometry>
<box size="0.1 0.05 .005"/>
</geometry>
</collision>
<visual>
<origin rpy="0 0 0" xyz="0.05 0 0"/>
<geometry>
<box size="0.1 0.05 .005"/>
</geometry>
</visual>
</link>
<link name="human/left_hand"/>
<!-- Joints -->
<joint name="left_arm_mount" type="fixed">
<origin rpy="0 0 1.57079632679" xyz="0 0.181172520845 -0.00609526854636"/>
<parent link="human/shoulder_center"/>
<child link="human/left_shoulder"/>
</joint>
<!-- END SHOULDER -->
<joint name="left_elbow_0" type="fixed">
<origin rpy="0 0 0" xyz="0.294151609476 0 0"/>
<parent link="human/left_shoulder"/>
<child link="human/left_elbow"/>
</joint>
<joint name="left_wrist_0" type="fixed">
<origin rpy="0 0 0" xyz="0.274149473988 0 0"/>
<parent link="human/left_elbow"/>
<child link="human/left_wrist"/>
</joint>
<joint name="left_hand" type="fixed">
<origin rpy="0 0 0" xyz="0.1 0 0"/>
<parent link="human/left_wrist"/>
<child link="human/left_hand"/>
</joint>
<!-- LEG -->
<link name="human/right_leg_mount"/>
<link name="human/right_hip_0"/>
<link name="human/right_hip_1"/>
<link name="human/right_hip">
<collision>
<origin rpy="0 1.57079632679 0" xyz="0.282210946758 0 0"/>
<geometry>
<cylinder length="0.564421893516" radius="0.05"/>
</geometry>
</collision>
<visual>
<origin rpy="0 1.57079632679 0" xyz="0.282210946758 0 0"/>
<geometry>
<cylinder length="0.564421893516" radius="0.05"/>
</geometry>
</visual>
</link>
<link name="human/right_knee">
<collision>
<origin rpy="0 1.57079632679 0" xyz="0.203668548616 0 0"/>
<geometry>
<cylinder length="0.407337097232" radius="0.025"/>
</geometry>
</collision>
<visual>
<origin rpy="0 1.57079632679 0" xyz="0.203668548616 0 0"/>
<geometry>
<cylinder length="0.407337097232" radius="0.025"/>
</geometry>
</visual>
</link>
<link name="human/right_ankle_0"/>
<link name="human/right_ankle">
<collision>
<origin rpy="0 0 0" xyz="0.05 0 0"/>
<geometry>
<box size="0.1 0.05 .005"/>
</geometry>
</collision>
<visual>
<origin rpy="0 0 0" xyz="0.05 0 0"/>
<geometry>
<box size="0.1 0.05 .005"/>
</geometry>
</visual>
</link>
<link name="human/right_foot"/>
<!-- Joints -->
<joint name="right_hip_leg_mount" type="fixed">
<origin rpy="0 1.57079632679 0" xyz="0 -0.080553532998 -0.0811138121076"/>
<parent link="human/pelvis"/>
<child link="human/right_leg_mount"/>
</joint>
<!-- hip : spherical -->
<joint name="right_hip_0" type="revolute">
<origin rpy="0 0 0" xyz="0 0 0"/>
<axis xyz="0 0 1"/>
<parent link="human/right_leg_mount"/>
<child link="human/right_hip_0"/>
<limit effort="1" lower="-1.57079632679" upper="1.57079632679" velocity="1"/>
</joint>
<joint name="right_hip_1" type="revolute">
<origin rpy="0 0 0" xyz="0 0 0"/>
<axis xyz="0 1 0"/>
<parent link="human/right_hip_0"/>
<child link="human/right_hip_1"/>
<limit effort="1" lower="-1.57079632679" upper="1.57079632679" velocity="1"/>
</joint>
<joint name="right_hip_2" type="revolute">
<origin rpy="0 0 0" xyz="0 0 0"/>
<axis xyz="1 0 0"/>
<parent link="human/right_hip_1"/>
<child link="human/right_hip"/>
<limit effort="1" lower="-1.57079632679" upper="1.57079632679" velocity="1"/>
</joint>
<!-- END hip -->
<joint name="right_knee_0" type="revolute">
<origin rpy="1.57079632679 0 0" xyz="0.564421893516 0 0"/>
<axis xyz="0 0 1"/>
<parent link="human/right_hip"/>
<child link="human/right_knee"/>
<limit effort="1" lower="-3.14159265359" upper="0.1" velocity="1"/>
</joint>
<!-- ankle : spherical -->
<joint name="right_ankle_0" type="revolute">
<origin rpy="-1.57079632679 0 1.57079632679" xyz="0.407337097232 0 0"/>
<axis xyz="0 0 1"/>
<parent link="human/right_knee"/>
<child link="human/right_ankle_0"/>
<limit effort="1" lower="-1.57079632679" upper="1.57079632679" velocity="1"/>
</joint>
<joint name="right_ankle_1" type="revolute">
<origin rpy="0 0 0" xyz="0 0 0"/>
<axis xyz="0 1 0"/>
<parent link="human/right_ankle_0"/>
<child link="human/right_ankle"/>
<limit effort="1" lower="-1.57079632679" upper="1.57079632679" velocity="1"/>
</joint>
<!-- END ankle -->
<joint name="right_foot" type="fixed">
<origin rpy="0 0 0" xyz="0.1 0 0"/>
<parent link="human/right_ankle"/>
<child link="human/right_foot"/>
</joint>
<link name="human/left_leg_mount"/>
<link name="human/left_hip_0"/>
<link name="human/left_hip_1"/>
<link name="human/left_hip">
<collision>
<origin rpy="0 1.57079632679 0" xyz="0.282210946758 0 0"/>
<geometry>
<cylinder length="0.564421893516" radius="0.05"/>
</geometry>
</collision>
<visual>
<origin rpy="0 1.57079632679 0" xyz="0.282210946758 0 0"/>
<geometry>
<cylinder length="0.564421893516" radius="0.05"/>
</geometry>
</visual>
</link>
<link name="human/left_knee">
<collision>
<origin rpy="0 1.57079632679 0" xyz="0.203668548616 0 0"/>
<geometry>
<cylinder length="0.407337097232" radius="0.025"/>
</geometry>
</collision>
<visual>
<origin rpy="0 1.57079632679 0" xyz="0.203668548616 0 0"/>
<geometry>
<cylinder length="0.407337097232" radius="0.025"/>
</geometry>
</visual>
</link>
<link name="human/left_ankle_0"/>
<link name="human/left_ankle">
<collision>
<origin rpy="0 0 0" xyz="0.05 0 0"/>
<geometry>
<box size="0.1 0.05 .005"/>
</geometry>
</collision>
<visual>
<origin rpy="0 0 0" xyz="0.05 0 0"/>
<geometry>
<box size="0.1 0.05 .005"/>
</geometry>
</visual>
</link>
<link name="human/left_foot"/>
<!-- Joints -->
<joint name="left_hip_leg_mount" type="fixed">
<origin rpy="0 1.57079632679 0" xyz="0 0.080553532998 -0.0811138121076"/>
<parent link="human/pelvis"/>
<child link="human/left_leg_mount"/>
</joint>
<!-- hip : spherical -->
<joint name="left_hip_0" type="revolute">
<origin rpy="0 0 0" xyz="0 0 0"/>
<axis xyz="0 0 1"/>
<parent link="human/left_leg_mount"/>
<child link="human/left_hip_0"/>
<limit effort="1" lower="-1.57079632679" upper="1.57079632679" velocity="1"/>
</joint>
<joint name="left_hip_1" type="revolute">
<origin rpy="0 0 0" xyz="0 0 0"/>
<axis xyz="0 1 0"/>
<parent link="human/left_hip_0"/>
<child link="human/left_hip_1"/>
<limit effort="1" lower="-1.57079632679" upper="1.57079632679" velocity="1"/>
</joint>
<joint name="left_hip_2" type="revolute">
<origin rpy="0 0 0" xyz="0 0 0"/>
<axis xyz="1 0 0"/>
<parent link="human/left_hip_1"/>
<child link="human/left_hip"/>
<limit effort="1" lower="-1.57079632679" upper="1.57079632679" velocity="1"/>
</joint>
<!-- END hip -->
<joint name="left_knee_0" type="revolute">
<origin rpy="1.57079632679 0 0" xyz="0.564421893516 0 0"/>
<axis xyz="0 0 1"/>
<parent link="human/left_hip"/>
<child link="human/left_knee"/>
<limit effort="1" lower="-3.14159265359" upper="0.1" velocity="1"/>
</joint>
<!-- ankle : spherical -->
<joint name="left_ankle_0" type="revolute">
<origin rpy="-1.57079632679 0 1.57079632679" xyz="0.407337097232 0 0"/>
<axis xyz="0 0 1"/>
<parent link="human/left_knee"/>
<child link="human/left_ankle_0"/>
<limit effort="1" lower="-1.57079632679" upper="1.57079632679" velocity="1"/>
</joint>
<joint name="left_ankle_1" type="revolute">
<origin rpy="0 0 0" xyz="0 0 0"/>
<axis xyz="0 1 0"/>
<parent link="human/left_ankle_0"/>
<child link="human/left_ankle"/>
<limit effort="1" lower="-1.57079632679" upper="1.57079632679" velocity="1"/>
</joint>
<!-- END ankle -->
<joint name="left_foot" type="fixed">
<origin rpy="0 0 0" xyz="0.1 0 0"/>
<parent link="human/left_ankle"/>
<child link="human/left_foot"/>
</joint>
<link name="human/foot">
<collision>
<origin rpy="0 0 0" xyz="0.05 0 0"/>
<geometry>
<box size="1 0.05 .005"/>
</geometry>
</collision>
<visual>
<origin rpy="0 0 0" xyz="0.05 0 0"/>
<geometry>
<box size="1 0.05 .005"/>
</geometry>
</visual>
</link>
<joint name="left_foot_base" type="fixed">
<origin rpy="0 0 0" xyz="0.1 0 0"/>
<parent link="human/left_ankle"/>
<child link="human/foot"/>
</joint>
<joint name="right_foot_base" type="fixed">
<origin rpy="0 0 0" xyz="0.1 0 0"/>
<parent link="human/right_ankle"/>
<child link="human/foot"/>
</joint>
</robot>
Asked by panches on 2019-11-12 18:25:28 UTC
Comments
Two observations/comments:
Asked by gvdhoorn on 2019-11-13 02:19:26 UTC
you are correct, I edited my question, I hope it is clearer now.
Asked by panches on 2019-11-13 11:22:54 UTC