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

Generalize the blf-calibration-delta-updater script #361

Merged
merged 12 commits into from
Jul 9, 2021

Conversation

GiulioRomualdi
Copy link
Member

@GiulioRomualdi GiulioRomualdi commented Jul 7, 2021

This follows #358
TODO:

  • Update changelog
  • test the script on the robot

cc @S-Dafarra @isorrentino @traversaro

@GiulioRomualdi GiulioRomualdi self-assigned this Jul 8, 2021
utilities/calibration-delta-updater/README.md Outdated Show resolved Hide resolved
utilities/calibration-delta-updater/README.md Outdated Show resolved Hide resolved
robot_name icub

[left_leg]
expected_values (-45.9, 0.0, 0.0, 5.153, -46.9, -26.62)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You may add in_degrees in the name to have the unit of measurement clear

Comment on lines 110 to 113
parser.add_argument('-i', '--input', type=str, required=True, help='Input xml file')
parser.add_argument('-o', '--output', type=str, required=True, help='Output xml file')
parser.add_argument('-p', '--part', type=str, required=True, help='Name of the part.')
parser.add_argument('--config', type=str, required=False, help='Path or name of the configuration file',
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is slightly different from what is mentioned in the README. Not a big deal, but it could raise doubts

Comment on lines 140 to 144
new_offsets.append(compute_joint_offset(sensor_bridge, i, expected_values))

updated_offset = np.array(offsets) + np.array(new_offsets)
print_info("Previous offsets = " + str(['%.4f' % offset for offset in offsets]) + " deg")
print_info("New offsets = " + str(['%.4f' % offset for offset in updated_offset]) + " deg")
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I wonder if it could make sense to add some deadzones. Usually, we tend to avoid changing the deltas if the difference is very small.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We may ask the user if he wants to change the offset for a given joint. 🤔

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

That's a good option. Otherwise, also something that sets a specific entry of new_offsets to zero if it is lower than a specified threshold could do the trick.

@GiulioRomualdi GiulioRomualdi changed the title Generalized the blf-calibration-delta-updater script Generalize the blf-calibration-delta-updater script Jul 9, 2021
@GiulioRomualdi
Copy link
Member Author

GiulioRomualdi commented Jul 9, 2021

Hi @S-Dafarra in 736b63b I tried to apply what you suggested

expected_values_in_degrees (-46.99, 0.0, 0.0, 6.68, -45.256, -26.72)
control_board "right_leg"
joints_list ( "r_hip_pitch", "r_hip_roll", "r_hip_yaw", "r_knee", "r_ankle_pitch", "r_ankle_roll")
tolerance_in_degrees (0.01, 0.01, 0.01, 0.01, 0.01, 0.01)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Terminal line missing

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ops!

Comment on lines +118 to +123
parser.add_argument('-i', '--input', type=str, required=True, help='Path to the input xml file containing the calibration deltas')
parser.add_argument('-o', '--output', type=str,
required=True, help='Path to the output xml file containing the calibration deltas')
parser.add_argument('-p', '--part', type=str, required=True,
help='Name of the group will be loaded in the configuration file. For instance left_leg or right_leg.')
parser.add_argument('--config', type=str, required=False,
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The README documents only the "short" version (e.g. -p). It may be worth noting somewhere that also --part can be used, for example.

= yarp::os::ResourceFinder::getResourceFinderSingleton().findFileByName(
filename);
return impl.setFromFile(filePath);
})
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Not a big problem, but inserting actual logic in the pybind11 code instead of leaving the logic on the C++ Side and just keep pybind11 code to contain glue code may be a dangerous path, especially if in the future we amt/hope to generate automatically the pybind11 glue code.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I open an issue for this :)

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.

Modify the calibration-delta-updater to consider hard limits
3 participants