fix creation of std::vector
This commit is contained in:
@@ -198,8 +198,7 @@ PYBIND11_MODULE(_rollout, pymodule) {
|
|||||||
) {
|
) {
|
||||||
// get raw pointers
|
// get raw pointers
|
||||||
int nroll = state0.shape(0);
|
int nroll = state0.shape(0);
|
||||||
std::vector<const raw::MjModel*> model_ptrs;
|
std::vector<const raw::MjModel*> model_ptrs(nroll);
|
||||||
model_ptrs.reserve(nroll);
|
|
||||||
for (int r = 0; r < nroll; r++) {
|
for (int r = 0; r < nroll; r++) {
|
||||||
model_ptrs[r] = m[r].cast<const MjModelWrapper*>()->get();
|
model_ptrs[r] = m[r].cast<const MjModelWrapper*>()->get();
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user