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

Fix imu tf frame #373

Merged
merged 4 commits into from
Jul 26, 2024
Merged

Fix imu tf frame #373

merged 4 commits into from
Jul 26, 2024

Conversation

rafal-gorecki
Copy link
Contributor

@rafal-gorecki rafal-gorecki commented Jul 24, 2024

Description

In simulation the tf imu_link have diffternt transformation than in real robot.

Modifications

  • use current imu transform for simulation
  • merge imu_pos_x imu_pos_y imu_pos_z imu_rot_r imu_rot_p imu_rot_y into imu_xyz and imu_rpy
  • simplify URDF ns property

Summary by CodeRabbit

Summary by CodeRabbit

  • New Features

    • Introduced a launch argument to specify the Panther robot's hardware version for enhanced configurability.
    • Added a version specification for the Panther software in the robot spawn process.
  • Improvements

    • Simplified the launch configuration by consolidating IMU-related parameters, streamlining the setup process.
    • Enhanced clarity in the configuration by grouping IMU position and orientation parameters into two consolidated properties.
    • Improved namespace handling for better clarity and reduced potential errors.

Copy link
Contributor

coderabbitai bot commented Jul 24, 2024

Walkthrough

The recent updates streamline the Panther robot's launch files and URDF configurations by consolidating IMU parameters into simpler forms. A new argument for specifying the Panther software version enhances flexibility and clarity. These changes improve maintainability, simplify the launch process, and ensure functionality with a clearer parameter structure.

Changes

Files Change Summary
panther_controller/...controller.launch.py Consolidated IMU parameters into imu_xyz and imu_rpy, simplifying the launch configuration by removing individual position and orientation parameters.
panther_description/...load_urdf.launch.py Added a launch argument for specifying the Panther version and consolidated IMU parameters, enhancing launch setup clarity.
panther_description/...body.urdf.xacro Streamlined the body macro by consolidating IMU position and orientation parameters into two new parameters (imu_xyz, imu_rpy).
panther_description/...panther.urdf.xacro Removed several IMU-related arguments and updated references to the new consolidated parameters, simplifying the IMU configuration.
panther_description/...panther_macro.urdf.xacro Introduced conditional logic for IMU properties based on Panther version, improving configurability and reducing redundancy.
panther_gazebo/...spawn_robot.launch.py Added a new launch argument for the Panther software version, enhancing clarity without affecting existing functionality.

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>.
    • 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 generate interesting stats about this repository and render them as a table.
    • @coderabbitai show all the console.log statements in this repository.
    • @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 as 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 resolve resolve all the CodeRabbit review comments.
  • @coderabbitai configuration to show the current CodeRabbit configuration for the repository.
  • @coderabbitai help to get help.

Additionally, you can add @coderabbitai ignore anywhere in the PR description to prevent this PR from being reviewed.

CodeRabbit Configuration File (.coderabbit.yaml)

  • You can programmatically configure CodeRabbit by adding a .coderabbit.yaml file to the root of your repository.
  • Please see the configuration documentation for more information.
  • If your editor has YAML language server enabled, you can add the path at the top of this file to enable auto-completion and validation: # yaml-language-server: $schema=https://coderabbit.ai/integrations/schema.v2.json

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

Outside diff range, codebase verification and nitpick comments (1)
panther_controller/launch/controller.launch.py (1)

Environment variable PANTHER_ROBOT_VERSION is not set.

Please ensure that the PANTHER_ROBOT_VERSION environment variable is correctly set in the deployment environment. This variable is crucial for the correct functioning of the panther_version argument in the controller.launch.py file.

  • Verify the deployment scripts or environment configuration files to ensure PANTHER_ROBOT_VERSION is set.
  • Ensure that the environment variable is exported correctly before launching the application.
Analysis chain

Line range hint 68-68:
Ensure panther_version is correctly set.

The panther_version argument is set using an environment variable with a default value. Verify that this environment variable is set correctly in the deployment environment.

Scripts executed

The following scripts were executed for the analysis:

Script:

#!/bin/bash
# Description: Verify that the PANTHER_ROBOT_VERSION environment variable is set correctly.

# Test: Check the environment variable. Expect: PANTHER_ROBOT_VERSION to be set.
if [ -z "${PANTHER_ROBOT_VERSION}" ]; then
  echo "PANTHER_ROBOT_VERSION is not set"
else
  echo "PANTHER_ROBOT_VERSION is set to ${PANTHER_ROBOT_VERSION}"
fi

Length of output: 90

Review details

Configuration used: .coderabbit.yaml
Review profile: CHILL

Commits

Files that changed from the base of the PR and between cbaa053 and ca816ed.

Files selected for processing (7)
  • panther_controller/launch/controller.launch.py (1 hunks)
  • panther_description/launch/load_urdf.launch.py (5 hunks)
  • panther_description/urdf/body.urdf.xacro (2 hunks)
  • panther_description/urdf/gazebo.urdf.xacro (2 hunks)
  • panther_description/urdf/panther.urdf.xacro (2 hunks)
  • panther_description/urdf/panther_macro.urdf.xacro (2 hunks)
  • panther_gazebo/launch/spawn_robot.launch.py (1 hunks)
Files skipped from review due to trivial changes (3)
  • panther_description/urdf/gazebo.urdf.xacro
  • panther_description/urdf/panther.urdf.xacro
  • panther_gazebo/launch/spawn_robot.launch.py
Additional comments not posted (10)
panther_description/urdf/body.urdf.xacro (2)

7-7: Consolidate IMU parameters for simplicity.

The consolidation of IMU parameters into imu_xyz and imu_rpy enhances the macro's usability and clarity.


42-42: Update origin element with consolidated IMU parameters.

The origin element now uses imu_xyz and imu_rpy, maintaining functionality while simplifying the data structure.

panther_description/launch/load_urdf.launch.py (2)

91-96: Introduce panther_version argument for configurability.

The new panther_version argument enhances the configurability of the launch file by enabling the specification of the Panther robot's version at runtime.


188-188: Add declare_panther_version_arg to actions list.

The addition of declare_panther_version_arg ensures that the new panther_version argument is declared and available for use in the launch file.

panther_description/urdf/panther_macro.urdf.xacro (4)

13-20: Streamline IMU properties based on Panther version.

The conditional logic for defining IMU properties based on the Panther version streamlines the handling of IMU parameters and reduces redundancy.


22-22: Enhance namespace property definition.

The conditional expression for defining the namespace property enhances clarity and reduces the potential for errors in namespace handling.


35-36: Update body declaration with consolidated IMU parameters.

The body declaration now uses imu_xyz and imu_rpy, maintaining functionality while simplifying the data structure.


Line range hint 70-70:
Include Panther system parameters in ros2_control.

The inclusion of Panther system parameters in the ros2_control element ensures that the Panther system is correctly configured based on the provided parameters.

panther_controller/launch/controller.launch.py (2)

Line range hint 14-14:
Remove unused IMU parameters.

The removal of IMU parameters simplifies the launch configuration. Ensure that these parameters are not required elsewhere in the codebase.


Line range hint 15-15:
Add panther_version argument.

The addition of the panther_version argument enhances flexibility by allowing configuration based on the Panther hardware version.

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

Review details

Configuration used: .coderabbit.yaml
Review profile: CHILL

Commits

Files that changed from the base of the PR and between ca816ed and 2360198.

Files selected for processing (4)
  • panther_controller/launch/controller.launch.py (1 hunks)
  • panther_description/launch/load_urdf.launch.py (1 hunks)
  • panther_description/urdf/panther.urdf.xacro (2 hunks)
  • panther_description/urdf/panther_macro.urdf.xacro (2 hunks)
Files skipped from review as they are similar to previous changes (3)
  • panther_controller/launch/controller.launch.py
  • panther_description/launch/load_urdf.launch.py
  • panther_description/urdf/panther.urdf.xacro
Additional comments not posted (5)
panther_description/urdf/panther_macro.urdf.xacro (5)

11-12: Consolidate IMU properties.

The introduction of imu_xyz and imu_rpy properties simplifies the configuration by consolidating IMU position and rotation values. Ensure these default values are appropriate for all use cases.


20-20: Enhance namespace handling.

The introduction of the ns property with a conditional expression enhances clarity and minimizes potential errors in namespace handling. Ensure that the conditional expression is correct.


33-34: Simplify IMU configuration.

The usage of the imu_xyz and imu_rpy properties in the body.body declaration simplifies the configuration. Ensure the values are correctly passed to the body.body declaration.


11-12: Consolidate IMU properties.

The introduction of imu_xyz and imu_rpy properties simplifies the configuration by consolidating IMU position and rotation values. Ensure these default values are appropriate for all use cases.


15-17: Conditional IMU properties for simulation.

The conditional logic sets imu_xyz and imu_rpy properties based on the use_sim parameter, ensuring different configurations for simulation and real hardware. Verify that the values provided are correct for simulation.

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

Review details

Configuration used: .coderabbit.yaml
Review profile: CHILL

Commits

Files that changed from the base of the PR and between 2360198 and 9441bca.

Files selected for processing (1)
  • panther_description/urdf/panther_macro.urdf.xacro (2 hunks)
Files skipped from review as they are similar to previous changes (1)
  • panther_description/urdf/panther_macro.urdf.xacro
Additional context used
Learnings (1)
Common learnings
Learnt from: delihus
PR: husarion/panther_ros#373
File: panther_description/urdf/gazebo.urdf.xacro:9-9
Timestamp: 2024-07-25T16:10:26.126Z
Learning: When the user requests to find and apply similar patterns across the codebase, provide a detailed plan and necessary changes for the user to implement the changes.

@rafal-gorecki rafal-gorecki changed the base branch from ros2-devel to 2.1.0-20240723 July 25, 2024 16:14
@delihus delihus merged commit 04dfcbe into 2.1.0-20240723 Jul 26, 2024
@delihus delihus deleted the ros2-fix-imu-tf branch July 26, 2024 09:10
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