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

Mistake with units in "bb_shift_instructions()" in winston lutz code #522

Open
llorens99 opened this issue Oct 17, 2024 · 1 comment
Open

Comments

@llorens99
Copy link

I was looking to the bb_shift_instructions() function. The function currently provides numerical values that are correct, but the units indicated are inconsistent. The couch positions (couch_vrt, couch_lat, couch_lng) are defined in centimeters, but the output for the new couch coordinates is labeled as "mm" (millimeters).

Sorry for the inconveniences, I show the function I'm refering to just below, and the change I suggest to make.

    ----------
    couch_vrt : float
        The current couch vertical position in cm.
    couch_lng : float
        The current couch longitudinal position in cm.
    couch_lat : float
        The current couch lateral position in cm.
    """
    sv = self.bb_shift_vector
    x_dir = "LEFT" if sv.x < 0 else "RIGHT"
    y_dir = "IN" if sv.y > 0 else "OUT"
    z_dir = "UP" if sv.z > 0 else "DOWN"
    move = f"{x_dir} {abs(sv.x):2.2f}mm; {y_dir} {abs(sv.y):2.2f}mm; {z_dir} {abs(sv.z):2.2f}mm"
    if all(val is not None for val in [couch_vrt, couch_lat, couch_lng]):
        new_lat = round(couch_lat + sv.x / 10, 2)
        new_vrt = round(couch_vrt + sv.z / 10, 2)
        new_lng = round(couch_lng + sv.y / 10, 2)
        move += f"\nNew couch coordinates (mm): VRT: {new_vrt:3.2f}; LNG: {new_lng:3.2f}; LAT: {new_lat:3.2f}"
    return move

I would say that move should be:

   move += f"\nNew couch coordinates (cm): VRT: {new_vrt:3.2f}; LNG: {new_lng:3.2f}; LAT: {new_lat:3.2f}"
@jrkerns
Copy link
Owner

jrkerns commented Nov 18, 2024

Thanks. Will get it fixed.

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

No branches or pull requests

2 participants