Ignition(Gazebo) 수학 라이브러리

9008 단어 gazeborobotics

Gazebo 플러그인 구축



오늘 저는 최신 ROS(noetic) 환경에서 2014년에 작성한 Gazebo 플러그인을 컴파일하려고 했습니다. 당연히 오류가 있었고 컴파일에 실패했습니다.

fatal error: gazebo/math/gzmath.hh: No such file or directory
    7 | #include <gazebo/math/gzmath.hh>
      |          ^~~~~~~~~~~~~~~~~~~~~~~
compilation terminated.


먼저 내 PC에서 Gazebo 시뮬레이터 버전을 확인합니다. Gazebo 11입니다.



그런 다음 각각의 새로운 Gazebo 버전에 필요한 마이그레이션을 나타내는 this page을 찾습니다.

전망대 대 점화



흥미롭게도 네임스페이스 "gazebo"가 "ignition"으로 대체된 것을 볼 수 있습니다. 하지만 왜?

공식 사이트에서 답변을 봅니다.

We branded the new development effort Igntion in order to differentiate it from Gazebo that had come before, which is now referred to as Gazebo Classic. Those changes have gone very well, thanks in no small part to contributions and support from our worldwide community of users and other stakeholders.

In 2022 we encountered a trademark obstacle regarding the use of the name "Ignition". We used this as an opportunity to switch back the widely known name "Gazebo". Going forward, the modern robotics software collection formerly known as Ignition, is now branded Gazebo.



Gazebo 프로젝트의 로드맵:

Ignition Math 폴더 구조



다음은 로봇 운동학에 대한 전체 수학 지원을 제공해야 하는 저장소/usr/include/ignition/math6/의 모든 파일입니다.

├── 수학6
│ └── 점화
│ ├── 수학
│ │ ├── 각도.hh
│ │ ├── AxisAlignedBox.hh
│ │ ├── Box.hh
│ │ ├── Capsule.hh
│ │ ├── 색상.hh
│ │ ├── config.hh
│ │ ├── 실린더.hh
│ │ ├── 상세
│ │ │ ├── Box.hh
│ │ │ ├── Capsule.hh
│ │ │ ├── 실린더.hh
│ │ │ ├── Ellipsoid.hh
│ │ │ ├── 수출.hh
│ │ │ ├── Sphere.hh
│ │ │ └── WellOrderedVector.hh
│ │ ├── DiffDriveOdometry.hh
│ │ ├── Ellipsoid.hh
│ │ ├── 수출.hh
│ │ ├── 필터.hh
│ │ ├── Frustum.hh
│ │ ├── GaussMarkovProcess.hh
│ │ ├── 그래프
│ │ │ ├── Edge.hh
│ │ │ ├── GraphAlgorithms.hh
│ │ │ ├── 그래프.hh
│ │ │ └── 버텍스.hh
│ │ ├── Helpers.hh
│ │ ├── 관성.hh
│ │ ├── Kmeans.hh
│ │ ├── Line2.hh
│ │ ├── Line3.hh
│ │ ├── MassMatrix3.hh
│ │ ├── 소재.hh
│ │ ├── MaterialType.hh
│ │ ├── Matrix3.hh
│ │ ├── Matrix4.hh
│ │ ├── MovingWindowFilter.hh
│ │ ├── OrientedBox.hh
│ │ ├── PID.hh
│ │ ├── 비행기.hh
│ │ ├── 포즈3.hh
│ │ ├── Quaternion.hh
│ │ ├── 랜드.hh
│ │ ├── RollingMean.hh
│ │ ├── RotationSpline.hh
│ │ ├── SemanticVersion.hh
│ │ ├── SignalStats.hh
│ │ ├── SpeedLimiter.hh
│ │ ├── Sphere.hh
│ │ ├── SphericalCoordinates.hh
│ │ ├── Spline.hh
│ │ ├── 스톱워치.hh
│ │ ├── 온도.hh
│ │ ├── Triangle3.hh
│ │ ├── 삼각형.hh
│ │ ├── Vector2.hh
│ │ ├── Vector3.hh
│ │ ├── Vector3Stats.hh
│ │ └── Vector4.hh
│ └── 수학.hh

소스 코드 개선



this documentaiton의 도움으로 이전 소스 코드의 일부 라인을 업데이트했습니다. 그리고 마침내 플러그인을 성공적으로 빌드하고 .o 파일을 얻었습니다.

#include <ignition/math.hh>
    ...

// Load the controller
void WifibotControllerPlugin::Load(physics::ModelPtr _parent, sdf::ElementPtr _sdf)
{
    ...
    ignition::math::Pose3d pose;
    ignition::math::Vector3d pos;

#if GAZEBO_MAJOR_VERSION >= 8
    pose = this->parent->WorldPose();
#else
    pose = this->parent->GetWorldPose().Ign();
#endif

    robotPose[0] = pose.Pos().X();
    robotPose[1] = pose.Pos().Y();
    tf::Quaternion qt( pose.Rot().X(), pose.Rot().Y(), pose.Rot().Z(), pose.Rot().W() );
    ...
}

    ... 

void WifibotControllerPlugin::write_position_data()
{

    ignition::math::Pose3d orig_pose;


#if GAZEBO_MAJOR_VERSION >= 8
    orig_pose = this->parent->WorldPose();
#else
    orig_pose = this->parent->GetWorldPose().Ign();
#endif


  this->parent->SetWorldPose(ignition::math::Pose3d (robotPose[0], robotPose[1],  0, 0, 0, robotPose[2]  )   );

}



플러그인 로드



이제 플러그인이 제대로 작동하고 시뮬레이터에서 로봇을 제어할 수 있습니다.

좋은 웹페이지 즐겨찾기