@@ -78,9 +78,9 @@ sdf::Model GetSdf(const std::string &sdf_file_path,
7878 throw std::runtime_error (" Model not found in: " + sdf_file_path);
7979}
8080
81- gtsam::Pose3 Pose3FromIgnition (const ignition ::math::Pose3d &ignition_pose ) {
82- const auto &rot = ignition_pose .Rot ();
83- const auto &pos = ignition_pose .Pos ();
81+ gtsam::Pose3 Pose3FromGazebo (const gz ::math::Pose3d &gazebo_pose ) {
82+ const auto &rot = gazebo_pose .Rot ();
83+ const auto &pos = gazebo_pose .Pos ();
8484 return gtsam::Pose3 (
8585 gtsam::Rot3 (gtsam::Quaternion (rot.W (), rot.X (), rot.Y (), rot.Z ())),
8686 gtsam::Point3 (pos[0 ], pos[1 ], pos[2 ]));
@@ -115,7 +115,7 @@ Pose3 GetSdfLinkFrame(const sdf::Link *sdf_link) {
115115 }
116116
117117 // Pose is updated from joint frame to base frame.
118- const Pose3 bMl = Pose3FromIgnition (raw_pose);
118+ const Pose3 bMl = Pose3FromGazebo (raw_pose);
119119 return bMl;
120120}
121121
@@ -128,7 +128,7 @@ Pose3 GetJointFrame(const sdf::Joint &sdf_joint,
128128
129129 // Get the pose of the joint in the parent or child link's frame depending on
130130 // the value of `frame_name`.
131- Pose3 lTj = Pose3FromIgnition (sdf_joint.RawPose ());
131+ Pose3 lTj = Pose3FromGazebo (sdf_joint.RawPose ());
132132
133133 if (frame_name.empty () || frame_name == child_sdf_link->Name ()) {
134134 // If `frame_name` is empty or has the same name as the child_link, it means
@@ -175,12 +175,12 @@ LinkSharedPtr LinkFromSdf(uint8_t id, const sdf::Link &sdf_link) {
175175 // Get the pose of the link in the base frame
176176 // we only save the bMcom rest matrix as part of the Link class
177177 const Pose3 bMl = GetSdfLinkFrame (&sdf_link);
178- const Pose3 lMcom = Pose3FromIgnition (sdf_link.Inertial ().Pose ());
178+ const Pose3 lMcom = Pose3FromGazebo (sdf_link.Inertial ().Pose ());
179179 const Pose3 bMcom = bMl * lMcom;
180180
181181 return std::make_shared<Link>(id, sdf_link.Name (),
182- sdf_link.Inertial ().MassMatrix ().Mass (),
183- inertia, bMcom, bMl);
182+ sdf_link.Inertial ().MassMatrix ().Mass (),
183+ inertia, bMcom, bMl);
184184}
185185
186186LinkSharedPtr LinkFromSdf (uint8_t id, const std::string &link_name,
@@ -214,20 +214,20 @@ JointSharedPtr JointFromSdf(uint8_t id, const LinkSharedPtr &parent_link,
214214 switch (sdf_joint.Type ()) {
215215 case sdf::JointType::PRISMATIC :
216216 joint = std::make_shared<PrismaticJoint>(id, name, bMj, parent_link,
217- child_link, axis, parameters);
217+ child_link, axis, parameters);
218218 break ;
219219 case sdf::JointType::REVOLUTE :
220220 joint = std::make_shared<RevoluteJoint>(id, name, bMj, parent_link,
221- child_link, axis, parameters);
221+ child_link, axis, parameters);
222222 break ;
223223 case sdf::JointType::SCREW :
224224 joint = std::make_shared<HelicalJoint>(
225225 id, name, bMj, parent_link, child_link, axis, sdf_joint.ThreadPitch (),
226226 parameters);
227227 break ;
228228 case sdf::JointType::FIXED :
229- joint = std::make_shared<FixedJoint>(id, name, bMj, parent_link,
230- child_link);
229+ joint =
230+ std::make_shared<FixedJoint>(id, name, bMj, parent_link, child_link);
231231 break ;
232232 default :
233233 throw std::runtime_error (" Joint type for [" + name +
@@ -256,8 +256,8 @@ static LinkJointPair ExtractRobotFromSdf(const sdf::Model &sdf) {
256256 sdf::Joint sdf_joint = *sdf.JointByIndex (j);
257257
258258 // Get this joint's parent and child links.
259- std::string parent_link_name = sdf_joint.ParentLinkName ();
260- std::string child_link_name = sdf_joint.ChildLinkName ();
259+ std::string parent_link_name = sdf_joint.ParentName ();
260+ std::string child_link_name = sdf_joint.ChildName ();
261261 if (parent_link_name == " world" ) {
262262 // This joint fixes the child link in the world frame.
263263 LinkSharedPtr child_link = name_to_link[child_link_name];
0 commit comments