Skip to content

Conversation

@fjp
Copy link
Member

@fjp fjp commented Nov 9, 2020

I have added a xacro macro for motors in the include/common_macros.urdf.xacro.

image

If no mesh is provided in the new config/motor.yaml then a default box is used:

image

Other changes I have made (or that could be made):

  • renamed material: material_dark_grey to dark_grey

  • remove some whitespaces

  • For the config/motor.yaml I removed the top level motor: like it is done in base.yaml and front_wheel.yaml. This makes the code shorter inside common_macros.urdf.xacro. Maybe this could be used for the other yaml files as well because the description is already in the dictionary name, e.g. motor_props, base_prop, wheel_props. I think having base_prop['base']... and wheel_props['wheel']... is a bit redundant. What do you think? This could be addressed in the future. Maybe there is a problem without the top level name?

  • Updated the motor stl file to have its origin in the center (in Blender). This is done to match with the default box geometry.

  • added a colored stl wheel file: wheel-colored.stl for diffbot, which should fix the color in Gazebo. Only now the color doesn't work in RViz (rims and tires will have the same color).

  • Fix the wheel placement for diffbot

  • Add origin param to cylinder_inertia and box_inertia macros

  • add base footprint macro to common_macros.urdf.xacro and use it in diffbot.urdf.xacro

  • Fix wheel inertia (rotation by pi/2)

  • Fix base collision offset (remove z offset)

TODOS:

  • Add sensors (camera, RPLidar A2, Ultrasonic, ...). Maybe we could have a mesh folder for common sensors that are usable for different robots.
    • Add documentation (nearly the same as for the wheel)

@fjp fjp added the enhancement New feature or request label Nov 9, 2020
@fjp fjp mentioned this pull request Nov 9, 2020
fjp added 5 commits November 10, 2020 23:53
- add origin to box_inertia and cylinder_inertia macro (used for e.g.
  castor wheel)
- fix base link collision (removed offset error)
- fix wheel inertia (rotate by pi/2)
- add base footprint link and joint (common for mobile base robots)
- Incldue sensor macros
- Include new gazebo macro
- Use new base footprint macro
- Rename back caster to rear caster
@fjp fjp requested a review from pxalcantara November 10, 2020 23:06
@fjp fjp changed the title Add motor xacro v2 (no new stls with materials) Add motor xacro macro; add base_footprint macro; fix base collision; fix wheel inertia; Nov 10, 2020
<robot xmlns:xacro="http://www.ros.org/wiki/xacro" name="diffbot">

<xacro:property name="package_name" value="mobile_robot_description"/>
<xacro:property name="package_name" value="diffbot_description"/>
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think this parameter should be left as mobile_robot_description because is the name of the package and the path to find the files, isn't it?

<child link="${prefix}_motor"/>
<origin xyz="${pos_x_joint} ${reflect* pos_y_joint} ${pos_z_joint}" rpy="0 ${-pi/2.0*(reflect - 1)} 0"/>
<axis xyz="0 1 0" rpy="0 0 0" />
<!--origin xyz="${transX} ${reflect * (transY - wheel_width)} ${transZ}" rpy="${-pi/2.0*(reflect - 1)} 0 0" /-->
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can we delete these comments?

<!--axis xyz="0 1 0" rpy="0 0 ${pi/2.0*(reflect - 1)}" /-->
</joint>

<!--gazebo reference="${fb}_${lr}_motor">
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Are we gonna use this Gazebo color to the mesh?

- origin [block]: origin, position and orientation of the link;
-->
<xacro:macro name="footprint"
params="wheel_props">
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't think we're using the wheel_props parameter right? Please, can we remove it and also update the xacro documentation?

- l [float]: cylinder lenght (height);
-->
<xacro:macro name="cylinder_inertia" params="m r l">
<xacro:macro name="cylinder_inertia" params="m r l o_xyz:='0.0 0.0 0.0' o_rpy:='0.0 0.0 0.0'">
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please, add the parameter documentation of the origin parameter.

- z [float]: link dimension on the Z-axis;
-->
<xacro:macro name="box_inertia" params="m x y z">
<xacro:macro name="box_inertia" params="m x y z o_xyz:='0.0 0.0 0.0' o_rpy:='0.0 0.0 0.0'">
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please, add the parameter documentation of the origin parameter.

@pxalcantara
Copy link
Collaborator

Maybe this could be used for the other yaml files as well because the description is already in the dictionary name, e.g. motor_props, base_prop, wheel_props. I think having base_prop['base']... and wheel_props['wheel']... is a bit redundant. What do you think? This could be addressed in the future. Maybe there is a problem without the top level name?

Yes, I agree, I think we should remove this top-level layer. I'll open an issue to track this change 😉

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants