Skip to content

Commit 381ed09

Browse files
committed
feat: add flange in sim
1 parent fcde881 commit 381ed09

1 file changed

Lines changed: 5 additions & 5 deletions

File tree

‎src/sim/SimRobot.cpp‎

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -117,16 +117,16 @@ SimRobotState* SimRobot::get_state() {
117117
}
118118

119119
common::Pose SimRobot::get_cartesian_position() {
120+
return this->get_cartesian_flange_position() * cfg.tcp_offset;
121+
}
122+
123+
common::Pose SimRobot::get_cartesian_flange_position() {
120124
Eigen::Matrix<double, 3, 3, Eigen::RowMajor> rotation(
121125
this->sim->d->site_xmat + 9 * this->ids.attachment_site);
122126
Eigen::Vector3d translation(this->sim->d->site_xpos +
123127
3 * this->ids.attachment_site);
124128
common::Pose attachment_site(Eigen::Matrix3d(rotation), translation);
125-
return this->to_pose_in_robot_coordinates(attachment_site) * cfg.tcp_offset;
126-
}
127-
128-
common::Pose SimRobot::get_cartesian_flange_position() {
129-
return this->get_cartesian_position();
129+
return this->to_pose_in_robot_coordinates(attachment_site);
130130
}
131131

132132
void SimRobot::set_joint_position(const common::VectorXd& q) {

0 commit comments

Comments
 (0)