Gazebo | Ignition | Community
Ask Your Question
0

Gazebo crashing when setting VelocityTarget with joint controller

asked 2021-07-18 06:23:20 -0600

Juleslcmt gravatar image

Hello, I want to use JointController with PID to make my wheels moving realistically with forces. My code is working when using the usual joint motors, just like in the tutorial : http://gazebosim.org/tutorials?tut=se...

  this->model->GetJoint("orange_joint")->SetParam("fmax", 0, 100.0);
  this->model->GetJoint("orange_joint")->SetParam("vel", 0, 1.0);

But I want to use jointcontrollers as the speed is not continuous with this method. When I am trying with the jointcontroller :

this->driving_joint_controller = this->parent->GetJointController();
this->driving_joint_controller->Reset();
this->driving_joint_controller->AddJoint(this->driving_joint);
this->joint_name = this->driving_joint->GetScopedName();
this->driving_joint_controller->SetVelocityPID(this->joint_name, common::PID(100.0, 0.0, 0.0));

and in my update function :

double driving_joint_speed =
    this->target_drive_state.speed / this->wheel_radius;
this->driving_joint_controller->SetVelocityTarget(this->joint_name, driving_joint_speed); 
this->driving_joint_controller->Update();

It is crashing with this message :

gzclient: /build/ogre-1.9-kiU5_5/ogre-1.9-1.9.0+dfsg1/OgreMain/include/OgreAxisAlignedBox.h:251: void Ogre::AxisAlignedBox::setExtents(const Ogre::Vector3&, const Ogre::Vector3&): Assertion `(min.x <= max.x && min.y <= max.y && min.z <= max.z) && "The minimum corner of the box must be less than or equal to maximum corner"' failed.

I don't know how it is related, and it appears that the crash occurs only when the line this->driving_joint_controller->SetVelocityTarget(this->joint_name, driving_joint_speed); is in the code. Can you please help me with this ?

edit retag flag offensive close merge delete

1 Answer

Sort by ยป oldest newest most voted
0

answered 2022-11-25 10:39:43 -0600

Bracky gravatar image

Hello there, did you figured it out ?

edit flag offensive delete link more

Question Tools

1 follower

Stats

Asked: 2021-07-18 06:23:20 -0600

Seen: 172 times

Last updated: Nov 25 '22