Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Ros2 change wheels mount point #492

Open
wants to merge 4 commits into
base: ros2-devel
Choose a base branch
from

Conversation

KmakD
Copy link
Contributor

@KmakD KmakD commented Feb 5, 2025

Description

  • Mount wheel joints to wheel mount points instead of base_link
  • Update Lynx meshes
  • Fix Lynx dimensions

Requirements

  • Code style guidelines followed
  • Documentation updated

Tests 🧪

  • Robot
  • Container
  • Simulation

Summary by CodeRabbit

  • New Features

    • Introduced refined wheel mounting points across robot models to enhance alignment and performance.
  • Refactor

    • Streamlined physical configuration by replacing legacy positioning parameters with improved offset values.
    • Updated weight distribution and inertial properties for enhanced stability and accurate collision representation.
    • Simplified the design by removing non-essential components for a more robust and intuitive system setup.

Copy link
Contributor

coderabbitai bot commented Feb 5, 2025

Walkthrough

The changes update several configuration and URDF/XACRO files for the robotic vehicle. In the YAML configuration files, the wheel_separation parameter is removed and replaced by a new mount_point_offset parameter, with updates to values in one file also modifying mass and inertia. In the URDF/XACRO files, the wheel declarations and macro properties have been revised to use new mount point parameters (such as wheel_mount_point_x, wheel_mount_point_y, and wheelbase) and joint structures, while the lynx base file sees collision, inertial, and component removals.

Changes

File(s) Changes Summary
husarion_ugv_description/config/WH01.yaml
husarion_ugv_description/config/WH02.yaml
husarion_ugv_description/config/WH04.yaml
Removed the wheel_separation parameter; added a new mount_point_offset parameter (values: 0.091, 0.08165, and 0.06 respectively); other parameters remain unchanged.
husarion_ugv_description/config/WH05.yaml Removed the wheel_separation parameter; updated mass from 2.5 to 2.036; modified inertia (iyy from 0.0261 to 0.02593); added mount_point_offset: 0.06.
husarion_ugv_description/urdf/common/wheel.urdf.xacro Updated the wheel macro signature to use wheel_mount_point_x and wheel_mount_point_y (replacing wheel_separation_x); introduced the mount_point_offset property; changed the base joint from a continuous to a fixed joint; added a new base link for the wheel assembly.
husarion_ugv_description/urdf/lynx/base.urdf.xacro Modified the base_link collision element to use a collision mesh and updated its origin; revised inertial properties; removed elements related to user_compartment and battery (links and joints); adjusted origins for cover-related joints.
husarion_ugv_description/urdf/lynx/lynx_macro.urdf.xacro Replaced the wheel_separation_x property with wheelbase (maintaining the same numerical value); added a new property wheel_mount_point_y; updated wheel declarations to compute wheel_mount_point_x from wheelbase.
husarion_ugv_description/urdf/panther/panther_macro.urdf.xacro Replaced the wheel_separation_x property with wheelbase (value changed to 0.44); added a new property wheel_mount_point_y; updated each wheel declaration to use computed mount points (wheel_mount_point_x and wheel_mount_point_y).

Sequence Diagram(s)

sequenceDiagram
    participant URDF as Robot URDF
    participant WheelMacro as Wheel Macro
    participant FixedJoint as Fixed Joint
    participant BaseLink as Wheel Base Link
    participant WheelLink as Wheel Link

    URDF->>WheelMacro: Call wheel macro with configuration parameters
    WheelMacro->>WheelMacro: Compute mount points using wheelbase/2
    WheelMacro->>FixedJoint: Create fixed joint ("base_to_${prefix}_wheel_base_joint")
    FixedJoint->>BaseLink: Instantiate wheel base link
    BaseLink->>WheelLink: Connect via continuous joint to wheel link
Loading

Possibly related PRs

Suggested reviewers

  • rafal-gorecki

Tip

🌐 Web search-backed reviews and chat
  • We have enabled web search-based reviews and chat for all users. This feature allows CodeRabbit to access the latest documentation and information on the web.
  • You can disable this feature by setting web_search: false in the knowledge_base settings.
  • Please share any feedback in the Discord discussion.

Thank you for using CodeRabbit. We offer it for free to the OSS community and would appreciate your support in helping us grow. If you find it useful, would you consider giving us a shout-out on your favorite social media?

❤️ Share
🪧 Tips

Chat

There are 3 ways to chat with CodeRabbit:

  • Review comments: Directly reply to a review comment made by CodeRabbit. Example:
    • I pushed a fix in commit <commit_id>, please review it.
    • Generate unit testing code for this file.
    • Open a follow-up GitHub issue for this discussion.
  • Files and specific lines of code (under the "Files changed" tab): Tag @coderabbitai in a new review comment at the desired location with your query. Examples:
    • @coderabbitai generate unit testing code for this file.
    • @coderabbitai modularize this function.
  • PR comments: Tag @coderabbitai in a new PR comment to ask questions about the PR branch. For the best results, please provide a very specific query, as very limited context is provided in this mode. Examples:
    • @coderabbitai gather interesting stats about this repository and render them as a table. Additionally, render a pie chart showing the language distribution in the codebase.
    • @coderabbitai read src/utils.ts and generate unit testing code.
    • @coderabbitai read the files in the src/scheduler package and generate a class diagram using mermaid and a README in the markdown format.
    • @coderabbitai help me debug CodeRabbit configuration file.

Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments.

CodeRabbit Commands (Invoked using PR comments)

  • @coderabbitai pause to pause the reviews on a PR.
  • @coderabbitai resume to resume the paused reviews.
  • @coderabbitai review to trigger an incremental review. This is useful when automatic reviews are disabled for the repository.
  • @coderabbitai full review to do a full review from scratch and review all the files again.
  • @coderabbitai summary to regenerate the summary of the PR.
  • @coderabbitai generate docstrings to generate docstrings for this PR. (Beta)
  • @coderabbitai resolve resolve all the CodeRabbit review comments.
  • @coderabbitai configuration to show the current CodeRabbit configuration for the repository.
  • @coderabbitai help to get help.

Other keywords and placeholders

  • Add @coderabbitai ignore anywhere in the PR description to prevent this PR from being reviewed.
  • Add @coderabbitai summary to generate the high-level summary at a specific location in the PR description.
  • Add @coderabbitai anywhere in the PR title to generate the title automatically.

Documentation and Community

  • Visit our Documentation for detailed information on how to use CodeRabbit.
  • Join our Discord Community to get help, request features, and share feedback.
  • Follow us on X/Twitter for updates and announcements.

Copy link
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 0

🧹 Nitpick comments (2)
husarion_ugv_description/urdf/lynx/lynx_macro.urdf.xacro (1)

17-18: LGTM! Consider adding documentation for the mount point parameters.

The renaming to wheelbase improves clarity, and the new wheel_mount_point_y parameter aligns with the PR objective to change wheel mount points.

Consider adding XML comments to document:

  • The units (meters)
  • What these parameters represent in the robot's physical structure
  • Any constraints or valid ranges for these values
husarion_ugv_description/urdf/lynx/base.urdf.xacro (1)

22-28: LGTM! Consider documenting inertial properties source.

The updated inertial properties appear physically valid:

  • The inertia matrix is symmetric
  • The values satisfy the parallel axis theorem
  • The mass change is minimal and reasonable

Consider adding a comment documenting the source of these inertial properties (e.g., CAD model, physical measurements, etc.).

📜 Review details

Configuration used: .coderabbit.yaml
Review profile: CHILL
Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between be0e8da and 6296619.

⛔ Files ignored due to path filters (8)
  • husarion_ugv_description/meshes/WH05/fl_wheel.dae is excluded by !**/*.dae
  • husarion_ugv_description/meshes/WH05/fr_wheel.dae is excluded by !**/*.dae
  • husarion_ugv_description/meshes/WH05/rl_wheel.dae is excluded by !**/*.dae
  • husarion_ugv_description/meshes/WH05/rr_wheel.dae is excluded by !**/*.dae
  • husarion_ugv_description/meshes/lynx/base.dae is excluded by !**/*.dae
  • husarion_ugv_description/meshes/lynx/base_collision.dae is excluded by !**/*.dae
  • husarion_ugv_description/meshes/lynx/battery.dae is excluded by !**/*.dae
  • husarion_ugv_description/meshes/lynx/user_compartment.dae is excluded by !**/*.dae
📒 Files selected for processing (8)
  • husarion_ugv_description/config/WH01.yaml (1 hunks)
  • husarion_ugv_description/config/WH02.yaml (1 hunks)
  • husarion_ugv_description/config/WH04.yaml (1 hunks)
  • husarion_ugv_description/config/WH05.yaml (1 hunks)
  • husarion_ugv_description/urdf/common/wheel.urdf.xacro (1 hunks)
  • husarion_ugv_description/urdf/lynx/base.urdf.xacro (2 hunks)
  • husarion_ugv_description/urdf/lynx/lynx_macro.urdf.xacro (2 hunks)
  • husarion_ugv_description/urdf/panther/panther_macro.urdf.xacro (2 hunks)
⏰ Context from checks skipped due to timeout of 90000ms (2)
  • GitHub Check: Run unit tests hardware build type
  • GitHub Check: Run unit tests simulation build type
🔇 Additional comments (14)
husarion_ugv_description/config/WH04.yaml (1)

3-3: Add New Mount Point Offset Parameter

The mount_point_offset: 0.06 parameter has been added, replacing the old wheel_separation setting. This change aligns with the updated wheel mounting configuration. Ensure that any URDF or simulation references to this parameter are updated accordingly.

husarion_ugv_description/config/WH01.yaml (1)

3-3: Introduce Mount Point Offset for WH01

The new mount_point_offset: 0.091 parameter replaces the previously used wheel_separation value. Please confirm that the value is consistent with the physical and simulation requirements for the WH01 configuration and that all downstream configurations (e.g., URDF/XACRO files) reference the correct parameter.

husarion_ugv_description/config/WH02.yaml (1)

3-3: Update Parameter to Use Mount Point Offset in WH02

The parameter mount_point_offset: 0.08165 is now used in lieu of wheel_separation. This update is consistent with the new mounting strategy. Make sure that corresponding models and scripts correctly interpret this new parameter value.

husarion_ugv_description/config/WH05.yaml (2)

3-3: Set Mount Point Offset for WH05

A new parameter, mount_point_offset: 0.06, has been added. Verify that this value precisely reflects the intended mounting position for the WH05 configuration compared to other models in the suite.


4-5: Modify Physical Parameters for WH05

The mass has been updated to 2.036 and the inertia values have been slightly adjusted to { ixx: 0.014738, iyy: 0.02593, izz: 0.014738 }. These changes suggest a design revision for the physical properties. Ensure that these new values are validated against simulation results and the real-world model expectations.

husarion_ugv_description/urdf/panther/panther_macro.urdf.xacro (2)

22-23: LGTM! Improved property naming for wheel mounting points.

The change from wheel_separation_x to wheelbase uses more standard robotics terminology, and the new wheel_mount_point_y property clearly indicates its purpose for mounting point coordinates.


37-59: LGTM! Symmetric wheel mounting configuration.

The wheel declarations now use explicit mount points with symmetric positioning (wheelbase/2.0), which aligns with the PR objective to mount wheels at designated points.

Let's verify that the wheel.urdf.xacro file has been updated to support these new parameters:

✅ Verification successful

🏁 Script executed:

#!/bin/bash
# Description: Check if wheel.urdf.xacro supports the new mount point parameters

# Look for wheel_mount_point parameters in wheel.urdf.xacro
rg -A 5 "wheel_mount_point" "$(find . -name wheel.urdf.xacro)"

Length of output: 1914


Solid wheel configuration!
The output confirms that the wheel.urdf.xacro file has been updated to support the new mount point parameters. The parameter list now includes wheel_mount_point_x and wheel_mount_point_y, and each conditional block for the wheel prefixes (fl, fr, rl, rr) correctly uses these parameters—applying appropriate sign adjustments to ensure symmetric wheel placement.

  • The parameter declaration in wheel.urdf.xacro includes:
    params="wheel_config prefix wheel_mount_point_x wheel_mount_point_y"
  • The individual <xacro:if> blocks correctly reference these parameters to set the wheel positions based on the wheel prefix.

This confirms that the changes in panther_macro.urdf.xacro are fully supported downstream.

husarion_ugv_description/urdf/common/wheel.urdf.xacro (3)

5-6: LGTM! Parameter changes align with PR objectives.

The updated parameters (wheel_mount_point_x and wheel_mount_point_y) provide more explicit control over wheel positioning compared to the previous wheel_separation_x parameter, improving clarity of the wheel mounting configuration.


8-35: LGTM! Property definitions maintain wheel symmetry.

The property definitions correctly handle:

  • Wheel positioning using mount points
  • Symmetrical offsets for left/right wheels
  • Consistent pattern across all four wheels

37-53: Verify impact on existing configurations and controllers.

The new joint structure improves modularity by separating the mounting point (fixed joint) from wheel rotation (continuous joint). This is a good architectural change.

Please verify:

  1. Existing robot configurations are updated to handle the new joint structure
  2. Controllers are configured to use the correct joint names
  3. Simulation models work correctly with the new joint hierarchy
husarion_ugv_description/urdf/lynx/lynx_macro.urdf.xacro (1)

32-54: LGTM! Verify wheel mount point calculations.

The changes consistently apply the new mount point parameters across all wheels, with correct symmetrical placement using wheelbase/2.0.

Please verify:

  1. The wheel mount points match the physical robot's dimensions
  2. The mount points are compatible with the wheel configuration in the YAML file
  3. The simulation behaves correctly with these mount points
husarion_ugv_description/urdf/lynx/base.urdf.xacro (3)

47-59: Verify impact of joint position adjustments on robot configuration.

The changes to joint positions affect the overall robot height:

  • base_to_cover_joint: +1.3mm in Z
  • cover_to_mount_joint: -9.8mm in Z
    Net change: -8.5mm in total height

Please confirm:

  1. These adjustments align with the physical robot's dimensions
  2. The wheel mount points are correctly positioned relative to these joints
  3. The changes don't affect any sensors or accessories mounted on the robot

Consider extracting these dimensions as xacro properties at the top of the file for easier maintenance and configuration.


1-64: Verify impact of removed components.

The removal of user_compartment and battery components from the URDF represents a significant change to the robot model.

Please confirm:

  1. The battery is now integrated differently in the physical robot
  2. User compartment functionality is handled through alternative means
  3. Documentation has been updated to reflect these changes
  4. Dependent packages have been updated to handle these removals

Consider adding a comment in the URDF explaining the architectural decision to remove these components and how their functionality is now handled.


15-19: Verify the collision mesh properties.

The change from a primitive box to a mesh-based collision model is good for accuracy. However, ensure that:

  1. The collision mesh is a simplified version of the visual mesh
  2. The mesh is convex or decomposed into convex shapes for efficient collision checking
✅ Verification successful

🏁 Script executed:

#!/bin/bash
# Check if the collision mesh exists and examine its properties
if [ -f "husarion_ugv_description/meshes/lynx/base_collision.dae" ]; then
    echo "Collision mesh found"
    # Print basic info about the mesh file
    file "husarion_ugv_description/meshes/lynx/base_collision.dae"
else
    echo "Error: Collision mesh not found"
    exit 1
fi

Length of output: 277


🏁 Script executed:

#!/bin/bash
# List file details for the collision mesh and preview its content
ls -l husarion_ugv_description/meshes/lynx/base_collision.dae
echo "-------- First 20 lines of the collision mesh --------"
head -n 20 husarion_ugv_description/meshes/lynx/base_collision.dae

Length of output: 1131


Collision mesh verification complete.

  • The collision mesh file (husarion_ugv_description/meshes/lynx/base_collision.dae) exists and is in a valid COLLADA format, generated with Blender.
  • Its file size (6.8 KB) suggests that it is likely a simplified version suitable for collision checking.
  • While the mesh structure appears correct, please manually verify that it meets the convexity (or convex decomposition) requirements for efficient collision detection if necessary.

Copy link
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 0

🧹 Nitpick comments (1)
husarion_ugv_description/urdf/panther/base.urdf.xacro (1)

24-30: Document the reasoning for the inertial coordinates.

The specific values chosen for the inertial origin coordinates (-0.008, 0.01, 0.029) appear to be precise measurements. Please add a comment explaining:

  1. How these values were determined (e.g., CAD model, physical measurements)
  2. Why this position better represents the robot's center of mass

Add a comment above the inertial section explaining the origin coordinates:

      <inertial>
+      <!-- Center of mass position determined from [source/method] -->
        <origin xyz="-0.008 0.01 0.029" rpy="0.0 0.0 0.0" />
📜 Review details

Configuration used: .coderabbit.yaml
Review profile: CHILL
Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 6296619 and 421af92.

📒 Files selected for processing (2)
  • husarion_ugv_description/urdf/lynx/base.urdf.xacro (2 hunks)
  • husarion_ugv_description/urdf/panther/base.urdf.xacro (1 hunks)
⏰ Context from checks skipped due to timeout of 90000ms (2)
  • GitHub Check: Run unit tests hardware build type
  • GitHub Check: Run unit tests simulation build type
🔇 Additional comments (5)
husarion_ugv_description/urdf/panther/base.urdf.xacro (1)

24-30: Verify the updated inertial properties in simulation.

The center of mass has been shifted from the origin to a new position (-8mm X, +10mm Y, +29mm Z). While this change likely complements the wheel mount point modifications mentioned in the PR, it's crucial to validate its impact on the robot's balance and motion characteristics.

Please ensure that:

  1. The robot maintains stability in various operating conditions
  2. The control system performs as expected with these new inertial properties
  3. The simulation results match the real robot's behavior
husarion_ugv_description/urdf/lynx/base.urdf.xacro (4)

22-28: Verify inertial properties match physical or CAD measurements.

The changes to mass and inertia values appear significant:

  • Mass increased by ~2% (30.0 → 30.656 kg)
  • Center of mass shifted to x=-0.052, y=0.001, z=0.038
  • Inertia matrix values updated

These changes will affect the robot's dynamic behavior and control performance.

Could you provide CAD screenshots or physical measurements to validate these values?


47-51: Verify impact of joint position adjustments on robot height.

The changes to joint positions affect the overall robot structure:

  • Cover joint moved up by 1.3mm
  • Mount joint moved down by 9.8mm
  • Net decrease in height by 8.5mm

Please confirm these adjustments align with the physical robot dimensions.

Also applies to: 55-59


1-64: Document the removal of user_compartment and battery components.

The AI summary indicates that user_compartment and battery components were removed from the URDF. Please:

  1. Confirm if these removals are intentional
  2. Update documentation to reflect these changes
  3. Verify that the power system is properly represented elsewhere in the model

15-20: Verify the collision mesh dimensions and simplicity.

The change from a box to a mesh-based collision model is good for accuracy. However, ensure that:

  1. The collision mesh exists at the specified path
  2. The collision mesh is simplified compared to the visual mesh for better performance
  3. The z=0.0 origin aligns with the actual base of the robot
✅ Verification successful

🏁 Script executed:

#!/bin/bash
# Check if the collision mesh file exists
fd -e dae "base_collision.dae" 

# List all meshes to compare visual vs collision complexity
fd -e dae . --exec echo "File: {}" ";" meshlabserver -i {} -om vc vn fc fn 2>/dev/null

Length of output: 165


🏁 Script executed:

#!/bin/bash
# List all .dae files in the repository to identify visual vs collision meshes
echo "Listing all .dae files:"
fd -e dae

# Count the number of triangles in the collision mesh to assess its complexity
echo "Counting <triangles occurrences in husarion_ugv_description/meshes/lynx/base_collision.dae:"
grep -o "<triangles" husarion_ugv_description/meshes/lynx/base_collision.dae | wc -l

Length of output: 1301


Collision Mesh Verification Passed

  • File Verification: The collision mesh file husarion_ugv_description/meshes/lynx/base_collision.dae exists.
  • Mesh Complexity: The file reports only 1 occurrence of <triangles, which indicates that the collision geometry is highly simplified.
  • Origin Alignment: The <origin xyz="0.0 0.0 0.0" ... /> correctly places the collision geometry at the base as intended.

These results confirm that the collision mesh is simplified compared to a detailed visual mesh and the configuration fits the intended design.

@KmakD KmakD requested a review from rafal-gorecki February 7, 2025 07:37
Copy link
Contributor

@rafal-gorecki rafal-gorecki left a comment

Choose a reason for hiding this comment

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

There is one more point about base to have one abstract frame as a primary one.
image

Comment on lines +22 to +23
<xacro:property name="wheelbase" value="0.44" />
<xacro:property name="wheel_mount_point_y" value="0.2575" />
Copy link
Contributor

Choose a reason for hiding this comment

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

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Wheelbase is a technical name and is often written as single word.
The wheel_mount_point_y is not related to track of the wheels. It is actually a point where wheel together with a hub connects to the robot. This point is almost at the side of the robots body

@@ -2,36 +2,49 @@
<robot xmlns:xacro="http://wiki.ros.org/xacro">

<!-- wheel defining macro -->
<xacro:macro name="wheel" params="wheel_config wheel_separation_x prefix">
<xacro:macro name="wheel"
params="wheel_config prefix wheel_mount_point_x wheel_mount_point_y">
Copy link
Contributor

Choose a reason for hiding this comment

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

Copy link
Contributor Author

Choose a reason for hiding this comment

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

As described above this is the mount point for the wheel not exactly position of the wheel itself

Comment on lines +17 to +18
<xacro:property name="wheelbase" value="0.35" />
<xacro:property name="wheel_mount_point_y" value="0.1675" />
Copy link
Contributor

Choose a reason for hiding this comment

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants