Skip to content

Commit

Permalink
Suggestion and namespace fix
Browse files Browse the repository at this point in the history
Signed-off-by: Jakub Delicat <[email protected]>
  • Loading branch information
delihus committed May 29, 2024
1 parent 87d423e commit 9413e8a
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 84 deletions.
2 changes: 1 addition & 1 deletion launch/gz_components.launch.py
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ def get_launch_description(name: str, package: str, namespace: str, component: y
device_namespace = get_value(component, "device_namespace")
robot_namespace = namespace

if not name.find("ur3") and not name.find("kinova"):
if "ur3" not in name and "kinova" not in name and "robotiq" not in name:
if len(robot_namespace) and robot_namespace[0] != "/":
robot_namespace = "/" + robot_namespace
if len(device_namespace) and device_namespace[0] != "/":
Expand Down
96 changes: 13 additions & 83 deletions urdf/components.urdf.xacro
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,8 @@
<xacro:property name="parent_link" value="${component['parent_link']}" scope="parent" />
<xacro:property name="xyz" value="${component['xyz']}" scope="parent" />
<xacro:property name="rpy" value="${component['rpy']}" scope="parent" />
<xacro:property name="device_namespace" value="${component['device_namespace']}" scope="parent" />
<xacro:property name="device_namespace" value="${component['device_namespace']}"
scope="parent" />

<xacro:if value="${type == 'CAM01'}">
<xacro:include
Expand Down Expand Up @@ -71,99 +72,28 @@
/>
</xacro:if>

<xacro:if value="${type == 'LDR10'}">
<xacro:include
filename="$(find ros_components_description)/urdf/ouster.urdf.xacro"
ns="lidar"
/>

<xacro:lidar.ouster
parent_link="${parent_link}"
xyz="${xyz}"
rpy="${rpy}"
namespace="${robot_namespace}"
device_namespace="${device_namespace}"
model="os0_32"
/>
</xacro:if>

<xacro:if value="${type == 'LDR11'}">
<xacro:include
filename="$(find ros_components_description)/urdf/ouster.urdf.xacro"
ns="lidar"
/>

<xacro:lidar.ouster
parent_link="${parent_link}"
xyz="${xyz}"
rpy="${rpy}"
namespace="${robot_namespace}"
device_namespace="${device_namespace}"
model="os0_64"
/>
</xacro:if>

<xacro:if value="${type == 'LDR12'}">
<xacro:include
filename="$(find ros_components_description)/urdf/ouster.urdf.xacro"
ns="lidar"
/>

<xacro:lidar.ouster
parent_link="${parent_link}"
xyz="${xyz}"
rpy="${rpy}"
namespace="${robot_namespace}"
device_namespace="${device_namespace}"
model="os0_128"
/>
</xacro:if>
<xacro:property name="ouster_models_dict"
value="${dict ([
('LDR10', 'os0_32'),
('LDR11', 'os0_64'),
('LDR12', 'os0_128'),
('LDR13', 'os1_32'),
('LDR14', 'os1_64'),
('LDR15', 'os1_128')
])}" />

<xacro:if value="${type == 'LDR13'}">
<xacro:if value="${type in ouster_models_dict}">
<xacro:include
filename="$(find ros_components_description)/urdf/ouster.urdf.xacro"
ns="lidar"
/>

<xacro:lidar.ouster
parent_link="${parent_link}"
xyz="${xyz}"
rpy="${rpy}"
namespace="${robot_namespace}"
device_namespace="${device_namespace}"
model="os1_32"
/>
</xacro:if>

<xacro:if value="${type == 'LDR14'}">
<xacro:include
filename="$(find ros_components_description)/urdf/ouster.urdf.xacro"
ns="lidar"
/>

<xacro:lidar.ouster
parent_link="${parent_link}"
xyz="${xyz}"
rpy="${rpy}"
namespace="${robot_namespace}"
device_namespace="${device_namespace}"
model="os1_64"
/>
</xacro:if>

<xacro:if value="${type == 'LDR15'}">
<xacro:include
filename="$(find ros_components_description)/urdf/ouster.urdf.xacro"
ns="lidar"
/>

<xacro:lidar.ouster
parent_link="${parent_link}"
xyz="${xyz}"
rpy="${rpy}"
namespace="${robot_namespace}"
device_namespace="${device_namespace}"
model="os1_128"
model="${ouster_models_dict[type]}"
/>
</xacro:if>

Expand Down

0 comments on commit 9413e8a

Please sign in to comment.