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

Fix out-of-bounds access in tutorial code #656

Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion docs/README-cpp.md
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,7 @@ Next, we'll apply the state and input constraints.
```cpp
// Start and end at rest
problem.SubjectTo(X.Col(0) == Eigen::Matrix<double, 2, 1>{{0.0}, {0.0}});
problem.SubjectTo(X.Col(N + 1) == Eigen::Matrix<double, 2, 1>{{r}, {0.0}});
problem.SubjectTo(X.Col(N) == Eigen::Matrix<double, 2, 1>{{r}, {0.0}});

// Limit velocity
problem.SubjectTo(-1 <= X.Row(1));
Expand Down
5 changes: 1 addition & 4 deletions docs/README-py.md
Original file line number Diff line number Diff line change
Expand Up @@ -28,9 +28,6 @@ import numpy as np
First, we need to make a problem instance.

```py
from jormungandr.optimization import OptimizationProblem
import numpy as np

T = 5.0 # s
dt = 0.005 # 5 ms
N = int(T / dt)
Expand Down Expand Up @@ -80,7 +77,7 @@ Next, we'll apply the state and input constraints.
```py
# Start and end at rest
problem.subject_to(X[:, 0] == np.array([[0.0], [0.0]]))
problem.subject_to(X[:, N + 1] == np.array([[r], [0.0]]))
problem.subject_to(X[:, N] == np.array([[r], [0.0]]))

# Limit velocity
problem.subject_to(-1 <= X[1, :])
Expand Down