Skip to content

Commit

Permalink
Merge pull request #28 from clearpathrobotics/rkreinin/fenders
Browse files Browse the repository at this point in the history
Added fenders for J100
  • Loading branch information
luis-camero authored Aug 9, 2023
2 parents d2e8fc5 + a490ddd commit c869050
Show file tree
Hide file tree
Showing 9 changed files with 83 additions and 27 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@

from clearpath_config.platform.attachments.config import BaseAttachment
from clearpath_config.platform.types.bumper import Bumper
from clearpath_config.platform.types.fender import Fender
from clearpath_config.platform.types.top_plate import TopPlate
from clearpath_config.platform.types.structure import Structure

Expand Down Expand Up @@ -70,6 +71,15 @@ def __init__(self, platform: str, attachment: Bumper) -> None:
self.EXTENSION: attachment.extension
})

class FenderDescription(BaseDescription):
MODEL = 'model'

def __init__(self, platform: str, attachment: Fender) -> None:
super().__init__(platform, attachment)
self.parameters.update({
self.MODEL: attachment.model,
})

class TopPlateDescription(BaseDescription):
MODEL = 'model'

Expand All @@ -92,6 +102,7 @@ def __init__(self, platform: str, attachment: Structure) -> None:

MODEL = {
Bumper.ATTACHMENT_MODEL: BumperDescription,
Fender.ATTACHMENT_MODEL: FenderDescription,
TopPlate.ATTACHMENT_MODEL: TopPlateDescription,
Structure.ATTACHMENT_MODEL: StructureDescription
}
Expand Down
Binary file not shown.
Empty file.

This file was deleted.

Empty file.
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
<?xml version="1.0"?>
<robot xmlns:xacro="http://ros.org/wiki/xacro">
<xacro:macro name="front_fender" params="model *origin">
<!-- Spawn fender link -->
<link name="front_fender_link">
<visual>
<geometry>
<xacro:if value="${model == 'default'}">
<mesh filename="package://clearpath_platform_description/meshes/j100/attachments/default_fender.stl" />
</xacro:if>
<xacro:if value="${model == 'sensor'}">
<mesh filename="package://clearpath_platform_description/meshes/j100/attachments/sensor_fender.stl" />
</xacro:if>
</geometry>
<material name="yellow" />
</visual>
</link>

<xacro:if value="${model == 'sensor'}">
<link name="front_fender_mount"/>
<joint name="front_fender_mount_joint" type="fixed">
<origin xyz="0.25629 0 0.07455" rpy="${pi} 0 0" />
<parent link="front_fender_link" />
<child link="front_fender_mount" />
</joint>
</xacro:if>

<!-- Attach fender -->
<joint name="front_fender_joint" type="fixed">
<origin xyz="0 0 0" rpy="0 0 0"/>
<parent link="base_link" />
<child link="front_fender_link" />
</joint>

</xacro:macro>
</robot>
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
<?xml version="1.0"?>
<robot xmlns:xacro="http://ros.org/wiki/xacro">
<xacro:macro name="rear_fender" params="model *origin">
<!-- Spawn fender link -->
<link name="rear_fender_link">
<visual>
<geometry>
<xacro:if value="${model == 'default'}">
<mesh filename="package://clearpath_platform_description/meshes/j100/attachments/default_fender.stl" />
</xacro:if>
<xacro:if value="${model == 'sensor'}">
<mesh filename="package://clearpath_platform_description/meshes/j100/attachments/sensor_fender.stl" />
</xacro:if>
</geometry>
<material name="yellow" />
</visual>
</link>

<xacro:if value="${model == 'sensor'}">
<link name="rear_fender_mount"/>
<joint name="rear_fender_mount_joint" type="fixed">
<origin xyz="0.25629 0 0.07455" rpy="${pi} 0 0" />
<parent link="rear_fender_link" />
<child link="rear_fender_mount" />
</joint>
</xacro:if>

<!-- Attach fender -->
<joint name="rear_fender_joint" type="fixed">
<origin xyz="0 0 0" rpy="0 0 ${pi}"/>
<parent link="base_link" />
<child link="rear_fender_link" />
</joint>

</xacro:macro>
</robot>

0 comments on commit c869050

Please sign in to comment.