Skip to content

Commit 8e2b650

Browse files
committed
rebase(push_anything_dev): fixes after rebase
1 parent db6b93a commit 8e2b650

File tree

8 files changed

+1236
-804
lines changed

8 files changed

+1236
-804
lines changed

MODULE.bazel

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -90,10 +90,14 @@ archive_override(
9090
)
9191

9292
bazel_dep(name = "c3")
93-
git_override(
93+
# git_override(
94+
# module_name = "c3",
95+
# remote = "https://github.com/DAIRLab/c3.git",
96+
# commit = "2bd13495c3306cf7d53992e2495774d1ad454cca"
97+
# )
98+
local_path_override(
9499
module_name = "c3",
95-
remote = "https://github.com/DAIRLab/c3.git",
96-
commit = "2bd13495c3306cf7d53992e2495774d1ad454cca"
100+
path = "/home/stephen/Workspace/DAIR/c3"
97101
)
98102

99103
INEKF_COMMIT = "297c308e50fa599af92ce3bd5f11d71e2bf8af69"

examples/sampling_c3/anything/parameters/sampling_c3plus_options.yaml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@ publish_frequency: 0
1515
penalize_input_change: false # Penalize (u-u_prev) instead of u.
1616
num_friction_directions: 2
1717
spring_stiffness: 0.0 # Not used in C3+.
18+
final_augmented_cost_scaling: 1000.0
1819

1920
N: 7
2021
gamma: 1.0 # discount factor on MPC costs
@@ -155,6 +156,7 @@ u_eta_position_list: [[1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
155156
# use_predicted_x0_reset_mechanism
156157
dt: 0 # instead: planning_dt_pose, planning_dt_position
157158
# solve_dt: 0 # unused
159+
dt_cost: 0
158160
mu: [] # instead based on indexing into mu_per_pair_type
159161
num_contacts: 0 # instead based on summing index of resolve_contacts_to_lists
160162
# Instead for the below, index into their _list versions.

examples/sampling_c3/generate_samples.cc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -827,7 +827,7 @@ bool IsSampleWithinDistanceOfSurface(
827827
multibody::GeomGeomCollider collider(plant, pair);
828828

829829
auto [phi_i, J_i] = collider.EvalPolytope(
830-
*context, sampling_c3_options.num_friction_directions);
830+
*context, sampling_c3_options.num_friction_directions.value());
831831
distances.push_back(phi_i);
832832
}
833833

examples/sampling_c3/parameter_headers/sampling_c3_options.h

Lines changed: 178 additions & 166 deletions
Large diffs are not rendered by default.

solvers/base_c3.cc

Lines changed: 429 additions & 429 deletions
Large diffs are not rendered by default.

solvers/base_c3.h

Lines changed: 32 additions & 32 deletions
Original file line numberDiff line numberDiff line change
@@ -47,38 +47,38 @@ class C3Base {
4747
/// @return void
4848
void Solve(const Eigen::VectorXd& x0, bool verbose = false);
4949

50-
/// Compute the MPC cost, using previously solved MPC solution.
51-
/// @param cost_type The method of computing the cost
52-
/// @param Kp_for_ee_pd_rollout Proportional gain for simulated EE PD control
53-
/// used for some of the cost types
54-
/// @param Kd_for_ee_pd_rollout Derivative gain for simulated EE PD control
55-
/// used for some of the cost types
56-
/// @param force_tracking_disabled Whether to simulate EE PD control with
57-
/// feedforward u from the MPC solution
58-
/// @param print_cost_breakdown Whether to print the cost breakdown
59-
/// @param verbose Whether to print additional information
60-
/// @return The cost and its associated state trajectory
61-
std::pair<double, std::vector<Eigen::VectorXd>> CalcCost(
62-
C3CostComputationType cost_type = kSimLCSReplaceC3EEPlan,
63-
std::vector<double> Kp_for_ee_pd_rollout = {0.0, 0.0, 0.0},
64-
std::vector<double> Kd_for_ee_pd_rollout = {0.0, 0.0, 0.0},
65-
bool force_tracking_disabled = false, int num_objects = 1,
66-
bool print_cost_breakdown = false, bool verbose = false) const;
67-
68-
/// Helper function to simulate the dynamics with PD control on the EE
69-
/// location and velocity plans, and the control input plans. Used for cost
70-
/// types that simulate the impedance control.
71-
/// @param Kp_for_ee_pd_rollout Proportional gain for simulated EE PD control
72-
/// @param Kd_for_ee_pd_rollout Derivative gain for simulated EE PD control
73-
/// @param force_tracking_disabled Whether to simulate EE PD control with
74-
/// feedforward u from the MPC solution
75-
/// @param verbose Whether to print additional information
76-
/// @return the simulated state and input trajectories
77-
std::pair<std::vector<Eigen::VectorXd>, std::vector<Eigen::VectorXd>>
78-
SimulatePDControl(std::vector<double> Kp_for_ee_pd_rollout = {0.0, 0.0, 0.0},
79-
std::vector<double> Kd_for_ee_pd_rollout = {0.0, 0.0, 0.0}, int num_objects = 1,
80-
bool force_tracking_disabled = false,
81-
bool verbose = false) const;
50+
// /// Compute the MPC cost, using previously solved MPC solution.
51+
// /// @param cost_type The method of computing the cost
52+
// /// @param Kp_for_ee_pd_rollout Proportional gain for simulated EE PD control
53+
// /// used for some of the cost types
54+
// /// @param Kd_for_ee_pd_rollout Derivative gain for simulated EE PD control
55+
// /// used for some of the cost types
56+
// /// @param force_tracking_disabled Whether to simulate EE PD control with
57+
// /// feedforward u from the MPC solution
58+
// /// @param print_cost_breakdown Whether to print the cost breakdown
59+
// /// @param verbose Whether to print additional information
60+
// /// @return The cost and its associated state trajectory
61+
// std::pair<double, std::vector<Eigen::VectorXd>> CalcCost(
62+
// C3CostComputationType cost_type = kSimLCSReplaceC3EEPlan,
63+
// std::vector<double> Kp_for_ee_pd_rollout = {0.0, 0.0, 0.0},
64+
// std::vector<double> Kd_for_ee_pd_rollout = {0.0, 0.0, 0.0},
65+
// bool force_tracking_disabled = false, int num_objects = 1,
66+
// bool print_cost_breakdown = false, bool verbose = false) const;
67+
68+
// /// Helper function to simulate the dynamics with PD control on the EE
69+
// /// location and velocity plans, and the control input plans. Used for cost
70+
// /// types that simulate the impedance control.
71+
// /// @param Kp_for_ee_pd_rollout Proportional gain for simulated EE PD control
72+
// /// @param Kd_for_ee_pd_rollout Derivative gain for simulated EE PD control
73+
// /// @param force_tracking_disabled Whether to simulate EE PD control with
74+
// /// feedforward u from the MPC solution
75+
// /// @param verbose Whether to print additional information
76+
// /// @return the simulated state and input trajectories
77+
// std::pair<std::vector<Eigen::VectorXd>, std::vector<Eigen::VectorXd>>
78+
// SimulatePDControl(std::vector<double> Kp_for_ee_pd_rollout = {0.0, 0.0, 0.0},
79+
// std::vector<double> Kd_for_ee_pd_rollout = {0.0, 0.0, 0.0}, int num_objects = 1,
80+
// bool force_tracking_disabled = false,
81+
// bool verbose = false) const;
8282

8383
/// Solve a single ADMM step.
8484
/// @param x0 The initial state of the system

0 commit comments

Comments
 (0)