diagnostics

Recording + visualization tools: time-series plots and an isometric MuJoCo animation, toggled with record:=true.

  • Build type: ament_python

  • Version: 0.0.1

  • License: Apache-2.0

  • Maintainer(s): nzge

  • Source: src/diagnostics/

Executables

Command (ros2 run)

Target

ros2 run diagnostics hardware_check

diagnostics.hardware_check:main

ros2 run diagnostics recorder

diagnostics.recorder:main

Launch files

diagnostics.launch.py

ros2 launch diagnostics diagnostics.launch.py

Source: diagnostics/launch/diagnostics.launch.py

Parameters & configuration

diagnostics_params.yaml

Node recorder

Parameter

Default

Type

output_dir

'/home/nzge/fishing-bot/software/recordings'

str

mjcf_path

''

str

render_script

''

str

venv_python

'/home/nzge/fishing-bot/.venv/bin/python'

str

auto_render

True

bool

video_format

'mp4'

str

video_fps

30

int

qpos_joints

['Joint_1', 'Joint_2', 'fish_swim']

list

arm_joints

['Joint_1', 'Joint_2']

list

Node hardware_check

Parameter

Default

Type

joints

['Joint_2']

list

move_delta

0.2

float

move_time

2.0

float

settle_time

1.0

float

position_tolerance

0.08

float

startup_timeout

15.0

float

tension_check_duration

3.0

float

tension_min

-50.0

float

tension_max

50.0

float

require_tension_variation

False

bool

Full file
# Recorder configuration.
#   output_dir   -> BASE dir; each run writes a <timestamp>/ subfolder inside it.
#                   Lives in the repo so recordings are versioned with the project.
#   mjcf_path    -> '' auto-resolves to description share / urdf / fishing-robot_sim.xml
#   render_script-> '' auto-resolves to diagnostics share / scripts / render_animation.py
recorder:
  ros__parameters:
    output_dir: "/home/nzge/fishing-bot/software/recordings"
    mjcf_path: ""
    render_script: ""
    # Python that can import mujoco (the project virtualenv) for the renderer.
    venv_python: "/home/nzge/fishing-bot/.venv/bin/python"
    auto_render: true
    video_format: "mp4"      # 'mp4' (needs imageio-ffmpeg) or 'gif'
    video_fps: 30
    qpos_joints: ["Joint_1", "Joint_2", "fish_swim"]
    arm_joints: ["Joint_1", "Joint_2"]

# Bring-up self-test (run with hardware_check:=true). Small, slow, open-loop
# moves + a tension sampling window; tune the safety margins for your rig.
hardware_check:
  ros__parameters:
    # Hardware is 1-DOF pitch (Joint_2 / Dynamixel ID 1); base not on the bus.
    joints: ["Joint_2"]
    move_delta: 0.2              # rad, per-joint test move
    move_time: 2.0              # s, trajectory duration (slow = gentle)
    settle_time: 1.0            # s, extra time to arrive
    position_tolerance: 0.08    # rad, pass band on reaching the target
    startup_timeout: 15.0       # s, wait for controllers/hardware
    tension_check_duration: 3.0 # s, sensor sampling window
    tension_min: -50.0
    tension_max: 50.0
    require_tension_variation: false

Source: diagnostics/config/diagnostics_params.yaml

Dependencies

  • Runtime: interfaces python3-matplotlib python3-numpy rclpy sensor_msgs trajectory_msgs

  • Test: ament_copyright ament_flake8 ament_pep257 python3-pytest

Python API

Full module/class/function reference for diagnostics is generated automatically: