Skip to content

Probabilistic contact estimator based on logistic regression#78

Open
MichaelMarav wants to merge 15 commits into
masterfrom
feature/probabilistic-contact
Open

Probabilistic contact estimator based on logistic regression#78
MichaelMarav wants to merge 15 commits into
masterfrom
feature/probabilistic-contact

Conversation

@MichaelMarav

Copy link
Copy Markdown
Collaborator

No description provided.

@MichaelMarav MichaelMarav requested a review from mrsp April 21, 2026 11:27
@MichaelMarav MichaelMarav self-assigned this Apr 21, 2026
Comment thread core/src/Serow.cpp Outdated
den += contact_estimators_.at(frame).getContactForce();
if (params_.estimate_contact_status && !contacts_probability.has_value()) {
// Logistic regression: P = 1 / (1 + exp(-(beta * fz + beta0)))
double fz = contacts_force[frame].z();

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

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

Try const double fz = R_foot_to_force * ft.at(frame).force;

Comment thread core/src/Serow.cpp Outdated
Eigen::Vector3d(-contacts_torque.at(frame).y() / z_force,
contacts_torque.at(frame).x() / z_force, 0.0);
if (!state.isPointFeet() && contacts_torque.count(frame) && state.contact_state_.contacts_probability.at(frame) > 0.0) {
double z_force = contacts_force.at(frame).z();

@mrsp mrsp Apr 22, 2026

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

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

Suggested change
double z_force = contacts_force.at(frame).z();
const double fz = contacts_force.at(frame).z();

Comment thread core/src/Serow.cpp Outdated
}
}
} else if (contacts_probability) {
if (contacts_probability.has_value()) {

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

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

looks like we can simplify the flow logic even further now:

if (contacts_probability.has_value()) {
  // use contact probs given
} else {
  // estimate your own by default making estimate_contact_status redundant now
}

Comment thread config/estimation.json Outdated
// the user should provide the end-effector contact probabilities
"estimate_contact_status": true,
// Coefficients for logistic regression probability contact estimator
"beta": 0.33,

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

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

some "tuning rules" on how to determine these are needed here since we support too many robots now.
e.g.
"beta" is % of m*g
"beta0" is ...

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.

2 participants