Skip to content

Commit 741e7f4

Browse files
Replicating granite table test for obstacle avoidance
1 parent e003944 commit 741e7f4

File tree

1 file changed

+27
-1
lines changed

1 file changed

+27
-1
lines changed

mobility/planner_scp_gusto/src/optim.cc

+27-1
Original file line numberDiff line numberDiff line change
@@ -3169,7 +3169,7 @@ int main() {
31693169

31703170
bool test_debug_obs_avoidance = false;
31713171

3172-
bool create_training_data = true;
3172+
bool create_training_data = false;
31733173
bool train_and_save_model = false;
31743174
bool load_and_run_inference = false;
31753175
bool test_warm_start = false;
@@ -3506,6 +3506,32 @@ int main() {
35063506
std::cout << "--------------------------------------------" << std::endl;
35073507
}
35083508

3509+
scp::TOP* top;
3510+
top = new scp::TOP(20., 401);
3511+
top->use_nn_warm_start = false;
3512+
top->is_granite = true;
3513+
top->x0 << -0.390941, 0.385616, -0.678817, 0, 0, 0, -0.00158839, 0.00167167, -0.00057889, 0.999997, 0, 0, 0;
3514+
top->xg << 0.5, -0.3, -0.67, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0;
3515+
3516+
top->radius_ = 0.26;
3517+
top->mass = 18.9715;
3518+
top->J << 0.2517, 0.0, 0.0,
3519+
0.0, 0.2517, 0.0,
3520+
0.0, 0.0, 0.0025;
3521+
top->Jinv = top->J.inverse();
3522+
3523+
Eigen::AlignedBox3d smallObstacle;
3524+
smallObstacle.extend(Eigen::Vector3d(-0.25, 0., -2));
3525+
smallObstacle.extend(Eigen::Vector3d(0., -0.25, 0));
3526+
top->keep_out_zones_.push_back(smallObstacle);
3527+
3528+
if (!top->Solve()) {
3529+
std::cout << "Problem could not be solved!" << std::endl;
3530+
} else {
3531+
std::cout << "Problem solved!" << std::endl;
3532+
}
3533+
std::cout << "--------------------------------------------" << std::endl;
3534+
35093535
// scp::TOP* top;
35103536
// top = new scp::TOP(20., 801);
35113537
// for (int ii = 0; ii < 100; ii++) {

0 commit comments

Comments
 (0)