Skip to content

Dimensional mismatch (unit error) in TrajBuilder::build_travel_traj #29

Description

@Tarkiya

Description

In src/traj_builder.cpp, the variable ramp_up_dist is calculated using alpha_max_ (angular acceleration) instead of accel_max_ (linear acceleration).

This is a dimensional mismatch: speed_max_^2 / alpha_max_ results in m^2/rad, whereas a distance calculation requires m. This logic error occurs when determining whether to use a trapezoidal or triangular velocity profile for straight-line motion.

Location

double ramp_up_dist = 0.5 * speed_max_ * speed_max_ / alpha_max_;

Proposed Solution

Replace the angular acceleration parameter with the linear acceleration parameter:

// Corrected Implementation
double ramp_up_dist = 0.5 * speed_max_ * speed_max_ / accel_max_;

Additional context

This issue was automatically flagged by our experimental LLM-assisted dimensional analysis tool and manually verified.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions