Skip to content

Commit b4a3315

Browse files
committed
Remove joint ids and joint names
1 parent 9ce070f commit b4a3315

File tree

4 files changed

+7
-25
lines changed

4 files changed

+7
-25
lines changed

bindings/expose-robot-handler.cpp

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,6 @@ namespace simple_mpc
3131
.def("getFeetIds", &RobotModelHandler::getFeetIds, bp::return_internal_reference<>())
3232
.def("getFootName", &RobotModelHandler::getFootName, bp::return_internal_reference<>())
3333
.def("getFeetNames", &RobotModelHandler::getFeetNames, bp::return_internal_reference<>())
34-
.def("getControlledJointNames", &RobotModelHandler::getControlledJointNames)
3534
.def("getFootId", &RobotModelHandler::getFootId)
3635
.def("getRefFootId", &RobotModelHandler::getRefFootId)
3736
.def("getMass", &RobotModelHandler::getMass)

examples/utils.py

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,8 +10,13 @@ def loadTalos():
1010
robotComplete = example_robot_data.load("talos")
1111
qComplete = robotComplete.model.referenceConfigurations["half_sitting"]
1212

13-
locked_joints = [20,21,22,23,28,29,30,31]
14-
locked_joints += [32, 33]
13+
locked_joints_names = ["arm_left_5_joint", "arm_left_6_joint", "arm_left_7_joint",
14+
"gripper_left_joint",
15+
"arm_right_5_joint", "arm_right_6_joint", "arm_right_7_joint",
16+
"gripper_right_joint",
17+
"head_1_joint",
18+
"head_2_joint"]
19+
locked_joints = [robotComplete.model.getJointId(el) for el in locked_joints_names]
1520
robot = robotComplete.buildReducedRobot(locked_joints, qComplete)
1621
rmodel: pin.Model = robot.model
1722
q0 = rmodel.referenceConfigurations["half_sitting"]

include/simple-mpc/robot-handler.hpp

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -38,11 +38,6 @@ namespace simple_mpc
3838
*/
3939
double mass_;
4040

41-
/**
42-
* @brief Joint id to be controlled in full model
43-
*/
44-
std::vector<unsigned long> controlled_joints_ids_;
45-
4641
/**
4742
* @brief Reference configuration and velocity (most probably null velocity)
4843
* to use
@@ -128,8 +123,6 @@ namespace simple_mpc
128123
return feet_names_;
129124
}
130125

131-
std::vector<std::string> getControlledJointNames() const;
132-
133126
FrameIndex getBaseFrameId() const
134127
{
135128
return base_id_;

src/robot-handler.cpp

Lines changed: 0 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
#include "simple-mpc/robot-handler.hpp"
22

3-
#include <iostream>
43
#include <pinocchio/algorithm/centroidal.hpp>
54
#include <pinocchio/algorithm/compute-all-terms.hpp>
65
#include <pinocchio/algorithm/crba.hpp>
@@ -14,10 +13,6 @@ namespace simple_mpc
1413
const Model & model, const std::string & reference_configuration_name, const std::string & base_frame_name)
1514
: model_(model)
1615
{
17-
// Controlled joints index
18-
for (auto joint_name : model_.names)
19-
controlled_joints_ids_.push_back(model.getJointId(joint_name));
20-
2116
// Root frame id
2217
base_id_ = model_.getFrameId(base_frame_name);
2318

@@ -65,16 +60,6 @@ namespace simple_mpc
6560
return dx;
6661
}
6762

68-
std::vector<std::string> RobotModelHandler::getControlledJointNames() const
69-
{
70-
std::vector<std::string> joint_names;
71-
for (JointIndex id : controlled_joints_ids_)
72-
{
73-
joint_names.push_back(model_.names.at(id));
74-
}
75-
return joint_names;
76-
}
77-
7863
RobotDataHandler::RobotDataHandler(const RobotModelHandler & model_handler)
7964
: model_handler_(model_handler)
8065
, data_(model_handler.getModel())

0 commit comments

Comments
 (0)