How to move a robot imported from a URDF file?

4 views (last 30 days)
My code so far:
%% Load Roomba
clear; clc; close all
%load roomba and plot
roomba = importrobot('myroomba.urdf');
figure
show(roomba)
Works great. This is a robot with two side wheels and an navigator wheel in the front. I just want it to move forward at least. Attached is what it looks like.
URDF Text:
<robot name="myroomba">
<!-- * * * Material Definitions * * * -->
<material name="Gray">
<color rgba="1 1 1 0"/>
</material>
<material name="Black">
<color rgba="0 0 0 1"/>
</material>
<!-- * * * Link Definitions * * * -->
<link name="base_link">
<visual>
<origin xyz="0 0 0" rpy="0 0 0"/>
<geometry>
<cylinder radius="0.2" length=".1"/>
</geometry>
<material name="Gray"/>
</visual>
</link>
<link name="rwheel">
<visual>
<origin xyz="0 0 0" rpy="0 0 0"/>
<geometry>
<cylinder radius="0.05" length="0.025"/>
</geometry>
<material name="Black"/>
</visual>
</link>
<link name="lwheel">
<visual>
<origin xyz="0 0 0" rpy="0 0 0"/>
<geometry>
<cylinder radius="0.05" length="0.025"/>
</geometry>
<material name="Black"/>
</visual>
</link>
<link name="fwheel">
<visual>
<origin xyz="0 0 0" rpy="0 0 0"/>
<geometry>
<cylinder radius="0.05" length="0.025"/>
</geometry>
<material name="Black"/>
</visual>
</link>
<!-- * * * Joint Definitions * * * -->
<joint name="base_joint" type="revolute">
<parent link="base_link"/>
<child link="rwheel"/>
<origin xyz="0.15 0 -.05" rpy="0 1.57 0"/>
<limit lower="-1.57" upper="1.57" effort="10" velocity="3"/>
<axis xyz="0 1 0"/>
</joint>
<joint name="base_joint1" type="revolute">
<parent link="base_link"/>
<child link="lwheel"/>
<origin xyz="-0.15 0 -0.05" rpy="0 1.57 0"/>
<limit lower="-1.57" upper="1.57" effort="10" velocity="3"/>
<axis xyz="0 1 0"/>
</joint>
<joint name="base_joint2" type="revolute">
<parent link="base_link"/>
<child link="fwheel"/>
<origin xyz="0 0.13 -.05" rpy="0 1.57 0"/>
<limit lower="-1.57" upper="1.57" effort="10" velocity="3"/>
<axis xyz="0 1 0"/>
</joint>
</robot>

Answers (0)

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!