Skip to Content
Robot Operating System Cookbook
book

Robot Operating System Cookbook

by Kumar Bipin
June 2018
Intermediate to advanced
484 pages
11h 36m
English
Packt Publishing
Content preview from Robot Operating System Cookbook

How it works…

To begin with xacro, we have to specify a namespace so that the file is parsed properly, as shown in the following code snippet:

<?xml version="1.0"?> 
<robot xmlns:xacro="http://www.ros.org/wiki/xacro" name="mobile">

We must remember that the file must have an xacro extension in place of URDF:

  1. Constants:
    • We can use xacro to declare constant values, just like we do in any other programming language. For example, in the case of the mobile robot which has four wheels with the same values for length and radius, this can be declared and defined as follows:
<xacro:property name="length_wheel" value="0.05" /> 
<xacro:property name="radius_wheel" value="0.05" /> 
    • These values can be used in the following ways, later in the code: ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Start your free trial

You might also like

Mobile Intelligent Autonomous Systems

Mobile Intelligent Autonomous Systems

Jitendra R. Raol, Ajith K. Gopal
Wheeled Mobile Robotics

Wheeled Mobile Robotics

Gregor Klancar, Andrej Zdesar, Saso Blazic, Igor Skrjanc

Publisher Resources

ISBN: 9781783987443Supplemental Content