Every control sits directly under the 3D view, so we can drag a slider and watch the robot change without scrolling. The explanation is beside it, not above it.
3D: drag to rotate · right-drag or shift-drag to slide · mouse wheel or two-finger pinch to zoom · double-click to reset
Two kinds of thing, and that is all. The robot has six of one and five of the other.
Every joint has a parent and a child. A part can be the child of only one joint, so nothing is ever attached twice. Follow the parents upward and we always arrive at one part that has no parent. Here that is base_footprint.
This is why positions are easy. We never give a part a position in the world. We only say where it sits relative to its parent. Move the chassis and the wheels come along for free.
base_footprint, a link with nothing in itOne line, and it proves a link does not have to contain anything.
“Create a part, call it base_footprint, it is finished.” The /> closes the tag immediately, which is only allowed because there is nothing inside.
It cannot be seen or touched and it weighs nothing. It is a named point in space: a pin stuck in the floor with a label on it.
The tree needs a root with no parent. By convention that root sits flat on the ground directly under the robot, so “where is the robot” has an obvious answer. Navigation software looks for this exact name.
base_footprint stops being on the floor, and everything reporting the robot’s position reports it wrong.base_link and the three boxes every real part hasEvery part that is actually there contains the same three boxes. See what the three are for and most of the file becomes repetition.
base_joint, how a part gets a positionTwo parts and no connection means the chassis is floating at the world origin, half buried. A joint fixes that, and it has only four things in it.
wheel_right_link, where the three boxes stop agreeingSame three boxes as the chassis. But on a wheel they describe three different shapes in three different places, and now we have the tools to see why.
wheel_right_joint, the first joint allowed to movebase_joint was welded shut. This one spins forever, which needs a different type and an axis.
28 lines almost identical to the right wheel. Here is every difference instead of reading them again.
| Line | Right | Left | Why |
|---|
axis does not flip. Both wheels use 0 1 0. The mirroring is already done by the joint position and the visual tilt; flipping the axis too would undo it, and the robot would spin on the spot when told to drive forward. The button under the view tries it.Two wheels cannot stand up alone. The casters are the feet that stop the robot tipping, and they introduce one new idea: a negative Z.
Real order, nothing skipped, blank lines included so the numbers match a text editor. Click any line.
Somebody measured a robot with a ruler and did six divisions. Drag the measurements and watch the file rewrite itself.
Each origin was explained inside the part that uses it. This is just a bench to compare them on: drag one and watch only its own object move.
Every origin inside a link is measured from the link’s own zero point, which is wherever the CAD model’s origin ended up. Not from the floor, not from the robot centre, not from the previous tag. The same starting point every time.
So when we see three different numbers inside one link, they are not three different coordinate systems. They are three different answers to “how far from the link’s zero point is my thing?”
| Origin inside | Moves | Does not move |
|---|
Take wheel_right_link. Its joint puts the link’s zero point at y = -0.0701. Now look at where the wheel actually is:
All three boxes are saying the same thing in their own words: “my thing is near the middle of the wheel, about 15 mm further out than the link’s zero point.” They differ slightly because the geometric middle and the centre of mass are not quite the same spot.
Because its mesh is already centred on the link origin in X and Y, so the picture needs no correction and the contact shape needs none either. But its <inertial> origin is 0 0 0.04, not zero, because the weight is not centred there: the chassis extends from 24.5 mm below the origin to 80 mm above it, so its mass sits high.
The inertial origin is the centre of mass, and it is not a mystery. It is a weighted average of position: every bit of the part pulls the balance point toward itself, in proportion to how heavy it is.
A worked example we can check in memory. Suppose a wheel is a 40 g rim sitting at 20 mm out along the axle and a 13 g hub sitting at 2 mm out:
That is all the CAD program did, over a few hundred thousand tiny volumes instead of two lumps.
Three concrete things, and nothing else:
What it does not change: how the robot looks, where it collides, or where any joint sits. That is why moving the inertial slider leaves the picture untouched.
Balance the real part on the edge of a ruler. Mark where it balances, turn it ninety degrees and do it again. Those two lines cross at the centre of mass. For most parts we can simply use the geometric centre, which is close enough for a simulation.
0 0 0. Load the mesh and look. If it appears in the wrong place or lying on its side, this is the only line that fixes it.Two weights on a bar. Slide them outward and the number climbs far faster than the distance does. That square is the whole idea.
Mass is how hard something is to push. Inertia is how hard it is to twist. They are separate properties and we need both.
A broom weighs almost nothing, so it is easy to push along. Spinning it end over end and it resists. Low mass, high inertia. Held in the middle instead, it spins easily: suddenly it is easy. Same broom, same mass, different inertia, because we changed where the mass sits relative to the axis.
Inertia is the sum of every bit of mass multiplied by the square of its distance from the axis.
That square is why it matters so much where the mass is. Move a weight twice as far out and it contributes four times as much. Drag the sliders on the left and watch the number climb far faster than the distance does.
| Shape | About which axis | Formula |
|---|
A wheel is close enough to a solid disc. The file gives mass and the mesh gives the radius and thickness, so we can compute what the inertia should be and compare it with what CAD wrote.
Within about 5 to 11 percent. The small excess is real: a tyre carries extra rubber at the rim, and mass further from the axis raises inertia. So the wheel numbers in the file are trustworthy, and now we know how to check that rather than take it on faith.
Every inertia has a hard ceiling. The most inertia a part can possibly have is when all of its mass sits at the furthest corner from the axis. Anything above that is impossible.
That second one, k, is the radius of gyration: the distance the whole mass would sit at if we squashed it into a ring. It must be smaller than the part’s own half-width, always.
The six numbers are a 3×3 table folded in half. ixx iyy izz on the diagonal are resistance about each axis. ixy ixz iyz are the products of inertia, and they measure lopsidedness: they are zero for a part that is symmetric about its axes, and grow when it is not. In the wheel they are around 1e-10, which is the file showing the wheel is almost perfectly symmetric. We will almost never set these by hand; leaving them at 0 is normal and fine.
The fix was explained on the chassis in section 03. This is a bench for it: rotate the frame and watch how little the numbers actually move.
This one appeared on the chassis, in section 03. 0 0 0.04 means the centre of mass sits 40 mm above the link origin. We get it from the CAD mass-properties panel, from the weighted-average formula, or by balancing the part on a ruler. It is a position.
This one is not a position and not an orientation of the part. It answers a narrower question: the six numbers in <inertia> were measured along some set of axes. Which axes?
An inertia tensor only means something relative to a set of axes. Write the same physical chassis along different axes and we get six different numbers for the same object. The rpy tells the simulator which axes these six numbers belong to, so it can convert them into the link’s own axes before using them.
| Style | rpy | the six inertia values | when to use it |
|---|
rpy="0 0 0". Done. Style B only appears when a datasheet gives us three principal moments and nothing else.The base_link does both at once, which is not either style:
A non-zero rpy says “my numbers are in a rotated frame”, and a rotated frame that is the principal frame is exactly the one where ixy, ixz and iyz are zero. The file supplies a rotation and three non-zero products. That combination is legal URDF, and it is not automatically wrong: rpy simply declares which axes the six values were measured along, and a tensor can carry cross terms in that frame. What makes it suspect here is the evidence, not the syntax.
I checked whether the rotation at least matches the tensor. The smallest rotation that would actually diagonalise these six numbers is about 12 degrees, as rpy = -0.004 -0.164 -0.130. The file writes 22 degrees, as rpy = 0.0 0.25 0.3. Same family, right pattern of no roll with some pitch and yaw, but the wrong magnitudes and the wrong signs. It reads like a principal-axis rotation that was rounded and sign-flipped on its way into the file.
Almost none, which is why nobody noticed. Drag the sliders and watch: at the file’s values the diagonal shifts by about a fifth of a percent. The products of inertia change more, but they were already small enough not to matter for a robot that only ever turns about Z.
rpy="0.0 0.0 0.0" and leave the six numbers exactly as they are. That makes the line say what the exporter almost certainly meant: “these six values are measured along the link’s own axes, about the centre of mass.” It is the honest version of the same data, and it removes a contradiction a reviewer would otherwise query. Note this is a separate problem from the magnitude issue in section 12: the tensor is also about 2.6 times larger than physically possible, and fixing the rpy does not fix that.Look at the wheels and the casters: all of them say rpy="0 0 0". Those are Style A, done correctly. Only base_link carries this rotation, which is another reason to treat it as a slip in that one export rather than something meaningful.
One table, sorted into three columns. Worth a skim even if nothing else here is.
| Value | Where it comes from | The job |
|---|
Tools → Evaluate → Mass Properties. That panel prints the mass, the centre of mass, and the full inertia tensor. Set the output coordinate system to the link origin we are exporting about, not the default, or the inertial origin will be measured from the wrong place. The sw2urdf exporter reads exactly this panel, which is why the numbers in the file have sixteen decimal places.Line 6 of file 1 is the hinge between the two files.
A copy-paste carried out before ROS ever sees the file. Xacro finds the package, opens that file, and drops its contents in at that spot. By the time the robot loads there is only one description containing both files.
Because the two answer different questions and change at different times. File 1 changes when we redesign the robot. File 2 changes when the robot slips and we tune it. Keeping them apart means tuning physics cannot break the geometry.
One per part that touches the ground: two wheels, two casters. Nothing is addressed to the chassis, because the chassis never touches anything.
Seven settings. Pick one, drag it, drive the robot and see what it was holding together.
Six settings instead of seven, and every one of them pushed to the opposite extreme from the wheel. Same treatment: pick a setting, see what it is for, and see what the wheel does differently.
| Setting | Wheel | Caster | Why |
|---|
fdir1. That line picks which direction mu1 applies along, and it only means something when mu1 and mu2 differ. The caster has equal grip in every direction on purpose, so there is nothing to point at.This is the honest answer, and it is different from file 1. There is no CAD panel, no ruler and no datasheet for mu1, kp, kd, minDepth or maxVel. They are not properties of the robot. They are knobs on the physics solver, and we set them by starting from known-good values and adjusting until the robot behaves.
mu1 is the only one with a real-world counterpart, the coefficient of friction, and the file deliberately ignores that counterpart: real rubber is about 0.9, the file says 1e15. The others describe how the solver resolves a contact, not how the robot is built. Ask “what is the kp of my wheel” and the question has no answer outside a simulator.
They come from the standard set that circulates in ROS differential-drive tutorials and templates. They are a known-good starting point for a small indoor two-wheeled robot, and nearly every bumperbot-style project uses the same figures. That is not a criticism: starting from values known to work and adjusting is the correct method here.
| Setting | Drive wheel | Sliding support | What it is doing |
|---|
We do not calculate these. We run the simulation, watch what goes wrong, and look up the symptom.
| What we see | Most likely cause | What to change |
|---|
kp from 1e12 to 2e12 does nothing we can see. Move it to 1e11 or 1e13 and watch. When the behaviour flips, we have bracketed the value and can close in.Same command to all three robots: both wheels forward at the same speed. The grey dashed line is where they should go.
| Question | Answered by | If that file is missing |
|---|