Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion src/urdf/UrdfBox.ts
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ export default class UrdfBox {

// Parse the xml string
const size: Optional<string[]> = xml.getAttribute(UrdfAttrs.Size)?.split(' ');
if (!size || size.length !== 3) {
if (size?.length !== 3) {
return;
}

Expand Down
2 changes: 1 addition & 1 deletion src/urdf/UrdfColor.ts
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ export default class UrdfColor {
constructor({ xml }: UrdfDefaultOptions) {
// Parse the xml string
const rgba: Optional<string[]> = xml.getAttribute(UrdfAttrs.Rgba)?.split(' ');
if (!rgba || rgba.length !== 4) {
if (rgba?.length !== 4) {
return;
}

Expand Down
2 changes: 1 addition & 1 deletion src/urdf/UrdfMesh.ts
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ export default class UrdfMesh {

// Check for a scale
const scale: Optional<string[]> = xml.getAttribute(UrdfAttrs.Scale)?.split(' ');
if (!scale || scale.length !== 3) {
if (scale?.length !== 3) {
return;
}

Expand Down
4 changes: 2 additions & 2 deletions src/urdf/UrdfUtils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ export function parseUrdfOrigin(originElement: Element): Pose {
// Check the XYZ
const xyz: string[] | undefined = originElement.getAttribute(UrdfAttrs.Xyz)?.split(' ');
let position: Vector3 = new Vector3();
if (xyz && xyz.length === 3) {
if (xyz?.length === 3) {
position = new Vector3({
x: parseFloat(xyz[0]),
y: parseFloat(xyz[1]),
Expand All @@ -18,7 +18,7 @@ export function parseUrdfOrigin(originElement: Element): Pose {
// Check the RPY
const rpy = originElement.getAttribute(UrdfAttrs.Rpy)?.split(' ');
let orientation = new Quaternion();
if (rpy && rpy.length === 3) {
if (rpy?.length === 3) {
// Convert from RPY
const roll = parseFloat(rpy[0]);
const pitch = parseFloat(rpy[1]);
Expand Down