Skip to content

Commit 4be87d3

Browse files
committed
Fixed bug that broke base only planning
1 parent 700cf7a commit 4be87d3

File tree

1 file changed

+6
-3
lines changed

1 file changed

+6
-3
lines changed

src/trajopt/configuration_space.cpp

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,8 @@ void RobotAndDOF::SetDOFValues(const DblVec& dofs) {
1414
OR::Transform T;
1515
OR::RaveGetTransformFromAffineDOFValues(T, dofs.begin()+joint_inds.size(), affinedofs, rotationaxis, true);
1616
robot->SetTransform(T);
17-
robot->SetDOFValues(dofs, false, joint_inds);
17+
if (joint_inds.size() > 0)
18+
robot->SetDOFValues(dofs, false, joint_inds);
1819
}
1920
else {
2021
robot->SetDOFValues(dofs, false, joint_inds);
@@ -23,7 +24,8 @@ void RobotAndDOF::SetDOFValues(const DblVec& dofs) {
2324

2425
DblVec RobotAndDOF::GetDOFValues() {
2526
DblVec out;
26-
robot->GetDOFValues(out, joint_inds);
27+
if (joint_inds.size() > 0):
28+
robot->GetDOFValues(out, joint_inds);
2729
if (affinedofs != 0) {
2830
out.resize(GetDOF());
2931
OR::Transform T = robot->GetTransform();
@@ -40,7 +42,8 @@ void RobotAndDOF::SetRobotActiveDOFs() {
4042
}
4143

4244
void RobotAndDOF::GetDOFLimits(DblVec& lower, DblVec& upper) const {
43-
robot->GetDOFLimits(lower, upper, joint_inds);
45+
if (joint_inds.size() > 0)
46+
robot->GetDOFLimits(lower, upper, joint_inds);
4447
const int translation_dofs[3] = {DOF_X, DOF_Y, DOF_Z};
4548
for (int i=0; i < 3; ++i) {
4649
if (affinedofs & translation_dofs[i]) {

0 commit comments

Comments
 (0)