clearpathrobotics / clearpath_config

Clearpath Configuration YAML Parser
https://docs.clearpathrobotics.com/
BSD 3-Clause "New" or "Revised" License
9 stars 8 forks source link

Clearpath Husky A200 | robot.yaml not picking extras urdf #46

Closed SOHAILMBS closed 10 months ago

SOHAILMBS commented 10 months ago

Please provide the following information:

Package: ros-humble-clearpath-common Status: install ok installed Priority: optional Section: misc Installed-Size: 41 Maintainer: Luis Camero lcamero@clearpathrobotics.com Architecture: amd64 Version: 0.2.1-1jammy.20231221.220210 Depends: ros-humble-clearpath-control, ros-humble-clearpath-description, ros-humble-clearpath-generator-common, ros-humble-clearpath-platform, ros-humble-ros-workspace Description: Clearpath Common Metapackage

To Reproduce

  1. sudo nano /etc/clearpath/robot.yaml
  2. Add requirements e.g.
    serial_number: a200-0000
    version: 1
    system:
    username: administrator
    hosts:
    self: cpr-a200-0000
    platform:
      cpr-a200-1005: 192.168.131.1
    onboard: {}
    remote: {}
    ros2:
    namespace: a200_0000
    domain_id: 0
    rmw_implementation: rmw_fastrtps_cpp
    workspaces: ['/home/administrator/ros2_ws/install/setup.bash']
    platform:
    controller: logitech
    battery:
    model: ES20_12C
    configuration: S2P1
    attachments:
    - name: front_bumper
      type: bumper
      parent: front_bumper_mount
    - name: rear_bumper
      type: bumper
      parent: rear_bumper_mount
    - name: top_plate
      type: top_plate
    extras:
    urdf: /home/administrator/ros2_ws/src/mybotshop/hsky_description/urdf/augments.urdf.xacro
    ros_parameters:
      platform_velocity_controller:
        linear.x.max_velocity": 1.0
        linear.x.min_velocity": -1.0
        linear.x.max_acceleration": 3.0
        linear.x.min_acceleration": -3.0
        angular.z.max_velocity": 2.0
        angular.z.min_velocity": -2.0
        angular.z.max_acceleration": 6.0
        angular.z.min_acceleration": -6.0
    links:
    box: []
    cylinder: []
    frame: []
    mesh: []
    sphere: []
    mounts:
    bracket: []
    fath_pivot: []
    riser: []
    disk: []
    post: []
    sensors:
    camera: []
    gps: []
    imu: []
    lidar2d: []
    lidar3d: []

4 . sudo systemctl restart clearpath-robot

  1. The error
    
    sudo systemctl status clearpath-platform.service 
    Warning: The unit file, source configuration file or drop-ins of clearpath-platform.service changed on disk. Run 'systemctl daemon-reload' to reload units.
    × clearpath-platform.service - "bringup clearpath-platform"
     Loaded: loaded (/lib/systemd/system/clearpath-platform.service; enabled; vendor preset: enabled)
     Active: failed (Result: exit-code) since Fri 2024-01-05 14:18:57 CET; 16min ago
    Main PID: 1191 (code=exited, status=1/FAILURE)
        CPU: 1.956s

Jan 05 14:18:55 Husky-A200-1005 administrator[1195]: clearpath-platform: Using workspace setup file /etc/clearpath/setup.bash Jan 05 14:18:55 Husky-A200-1005 clearpath-platform-start[1530]: ls: cannot access '/etc/ros/humble/clearpath-platform.d/*.xacro': No such file or directory Jan 05 14:18:56 Husky-A200-1005 clearpath-platform-start[1658]: [INFO] [launch]: All log files can be found below /tmp/2024-01-05-14-18-56-428094-Husky-A200-1005-1658 Jan 05 14:18:56 Husky-A200-1005 clearpath-platform-start[1658]: [INFO] [launch]: Default logging verbosity is set to INFO Jan 05 14:18:57 Husky-A200-1005 clearpath-platform-start[1658]: [ERROR] [launch]: Caught exception in launch (see debug for traceback): executed command failed. Command: /opt/ros/humble/bin/xacro /etc/clearpath/robot.urdf.xacro is_sim:=false gazebo_controllers:> Jan 05 14:18:57 Husky-A200-1005 clearpath-platform-start[1658]: Captured stderr output: error: No such file or directory: /.urdf.xacro [Errno 2] No such file or directory: '/.urdf.xacro' Jan 05 14:18:57 Husky-A200-1005 clearpath-platform-start[1658]: when processing file: /etc/clearpath/robot.urdf.xacro Jan 05 14:18:57 Husky-A200-1005 systemd[1]: clearpath-platform.service: Main process exited, code=exited, status=1/FAILURE Jan 05 14:18:57 Husky-A200-1005 systemd[1]: clearpath-platform.service: Failed with result 'exit-code'. Jan 05 14:18:57 Husky-A200-1005 systemd[1]: clearpath-platform.service: Consumed 1.956s CPU time.

**Other notes**
I have tried in the following formats:

```yaml
  extras:
    urdf: /home/administrator/ros2_ws/src/mybotshop/hsky_description/urdf/augments.urdf.xacro
  extras:
    urdf: /home/administrator/ros2_ws/src/mybotshop/hsky_description/urdf/augments.urdf
  extras:
    urdf: '/home/administrator/ros2_ws/src/mybotshop/hsky_description/urdf/augments.urdf.xacro'
  extras:
    urdf: ['/home/administrator/ros2_ws/src/mybotshop/hsky_description/urdf/augments.urdf.xacro']
  extras:
    urdf: [/home/administrator/ros2_ws/src/mybotshop/hsky_description/urdf/augments.urdf.xacro]

When I run ros2 run clearpath_robot install, everything is successful

candidate : /etc/clearpath/platform/launch/platform-service.launch.py
b'/usr/lib/systemd/systemd'
Preparing to install files to the following paths:
  /etc/ros/humble/clearpath-platform.d/.installed_files
  /etc/ros/humble/clearpath-platform.d/platform-service.launch.py
  /etc/systemd/system/multi-user.target.wants/clearpath-platform.service
  /lib/systemd/system/clearpath-platform.service
  /usr/sbin/clearpath-platform-start
  /usr/sbin/clearpath-platform-stop
Now calling: /usr/bin/sudo /opt/ros/humble/share/robot_upstart/scripts/mutate_files
Filesystem operation succeeded.
** To complete installation please run the following command:
 sudo systemctl daemon-reload && sudo systemctl start clearpath-platform
Preparing to install files to the following paths:
  /lib/systemd/system/clearpath-platform.service
Now calling: /usr/bin/sudo /opt/ros/humble/share/robot_upstart/scripts/mutate_files
Filesystem operation succeeded.
candidate : /etc/clearpath/sensors/launch/sensors-service.launch.py
b'/usr/lib/systemd/systemd'
Preparing to install files to the following paths:
  /etc/ros/humble/clearpath-sensors.d/.installed_files
  /etc/ros/humble/clearpath-sensors.d/sensors-service.launch.py
  /etc/systemd/system/multi-user.target.wants/clearpath-sensors.service
  /lib/systemd/system/clearpath-sensors.service
  /usr/sbin/clearpath-sensors-start
  /usr/sbin/clearpath-sensors-stop
Now calling: /usr/bin/sudo /opt/ros/humble/share/robot_upstart/scripts/mutate_files
Filesystem operation succeeded.
** To complete installation please run the following command:
 sudo systemctl daemon-reload && sudo systemctl start clearpath-sensors
Preparing to install files to the following paths:
  /lib/systemd/system/clearpath-sensors.service
Now calling: /usr/bin/sudo /opt/ros/humble/share/robot_upstart/scripts/mutate_files
Filesystem operation succeeded.
Preparing to install files to the following paths:
  /lib/systemd/system/clearpath-robot.service
  /usr/sbin/clearpath-robot-check
  /usr/sbin/clearpath-robot-generate
Now calling: /usr/bin/sudo /opt/ros/humble/share/robot_upstart/scripts/mutate_files
Filesystem operation succeeded.
** To complete installation please run the following command:
  sudo systemctl daemon-reload && sudo systemctl start clearpath-robot

Even with null option the error remains,

Manually updating the /etc/clearpath/robot.urdf.xacro fixes the error but i thinks gets over written when the generators run

It seems that the parser is not picking it up.

hilary-luo commented 10 months ago

@SOHAILMBS if you are having issues with clearpath_config please do provide the package version info for clearpath_config. I am assuming that you are using my latest changes based on the error that you are reporting.

See https://github.com/clearpathrobotics/clearpath_config/pull/45#issuecomment-1875576195 for the new formatting (documentation incoming to the docs website soon). You can still provide an absolute path in the new path parameter but if your urdf is being installed as part of a package then you can also now use the package name and relative link.

Unfortunately there is was an issue with how null is handled for an extras urdf which will be has been handled with https://github.com/clearpathrobotics/clearpath_config/pull/47. This update has now been released so you should be able to update your packages.

Feel free to let me know if you continue to have any issues beyond those mentioned above. There were specific circumstances that had us make a breaking change in a minor update, I'm sorry that you had to deal with that. We don't do it lightly.

SOHAILMBS commented 10 months ago

Thank you, I have tested with the new changes and it works well now and reports the error as well.

For those who come later, the format that worked for me was the following:

extras:
    urdf: 
        path: "/home/administrator/ros2_ws/src/mybotshop/hsky_description/urdf/augments.urdf.xacro"