/// \brief Try to kill a single process.
/// \param[in] _pid Process ID.
/// \param[in] _name Process name.
/// \param[in] _waittime Total time to wait in seconds.
/// \param[in,out] _killed Set to true if process was successfully killed.
/// \param[in,out] _status Store status information for that process.
static void kill_one_process(const int _pid, const std::string &_name,
                             const double _waittime, bool &_killed,
                             int &_status)
{
  kill(_pid, SIGINT);
  double sleepSecs = 0.001;
  // Wait some time and if not dead, escalate to SIGKILL
  for (unsigned int i = 0; i < (unsigned int)(_waittime / sleepSecs); ++i)
  {
    if (_killed)
    {
      break;
    }
    else
    {
      int p = waitpid(_pid, &_status, WNOHANG);
      if (p == _pid)
      {
        _killed = true;
        break;
      }
    }
    // Sleep briefly
    gazebo::common::Time::Sleep(gazebo::common::Time(sleepSecs));
  }
  if (!_killed)
  {
    std::cerr << "escalating to SIGKILL on " << _name << std::endl;
    kill(_pid, SIGKILL);
  }
}
/////////////////////////////////////////////////
void sig_handler(int /*signo*/)
{


[ ](javascript:; "Share Article") [
](//www.rssing.com/contact.php?r=o6&u=%2F%2Fgazebo214.rssing.com%2Fchan-57893035%2Flatest-
article2-live.php "Article Support")


[
![@davetcoleman](https://avatars.githubusercontent.com/u/561060?s=80&u=200346d5f870b7a99e0c188d7bb10b41f3635b84&v=4)
](/davetcoleman)


[ _≫_ Next: How to communicate Gazebo in Ubuntu with ROS Melodic and Unity 3d
in Windows ](//gazebo214.rssing.com/chan-57893035/latest.php#c57893035a6938
"Next Article")


Sorry, something went wrong.


[ _≪_ Previous: Tricycle drive plugin: Impossible to control linear and
angular speed at the same time
](//gazebo214.rssing.com/chan-57893035/latest.php#c57893035a6929 "Previous
Article")


[ ](//www.rssing.com/index.php?zw=2123 "Home") [ $ ](javascript:; "MoMoney")


[ ![@k-okada](https://avatars.githubusercontent.com/u/493276?s=40&v=4)
](/k-okada)


###  [ The Umbrella Academy’s Justin Min shares adorable first selfie with new
boyfriend
](////metro2989.rssing.com/chan-40972540/article57410.html#c40972540a57410i495009908)


[ _≫_ Next: Tricycle drive plugin: Impossible to control linear and angular
speed at the same time
](//gazebo214.rssing.com/chan-57893035/latest.php#c57893035a6929 "Next
Article")


[ hsu ](/hsu) pushed a commit that referenced this issue  Oct 17, 2014


By clicking “Sign up for GitHub”, you agree to our [ terms of service
](https://docs.github.com/terms) and [ privacy statement
](https://docs.github.com/privacy) . We’ll occasionally send you account
related emails.


sudo sh -c 'echo "deb http://packages.osrfoundation.org/gazebo/ubuntu-stable `lsb_release -cs` main" > /etc/apt/sources.list.d/gazebo-stable.list'


` [ temporary hack to **fix** the -J joint position option (issue
](/k-okada/gazebo_ros_pkgs/commit/4c33ec95e7fee2bce024ca0f5317bb6913ebdf0b
"temporary hack to **fix** the -J joint position option \(issue #93\),
sleeping for 1 second to avoid race condition. this branch should only be used
for debugging, merge only as a last resort.") [ ros-sim…
](https://github.com/ros-simulation/gazebo_ros_pkgs/issues/93) ` …  [
](/k-okada/gazebo_ros_pkgs/commit/4c33ec95e7fee2bce024ca0f5317bb6913ebdf0b#comments)


No one assigned


[ ![@m-talha](https://avatars.githubusercontent.com/u/15839351?s=80&v=4)
](/m-talha)


[ ` 99b9dc5 ` ](https://github.com/ros-
simulation/gazebo_ros_pkgs/commit/99b9dc598413ab37f6d5f7e67b005f195d88ccdc)
works for me, This will solve our problem posted on
[ https://groups.google.com/a/rethinkrobotics.com/forum/#!topic/brr-
users/QWITm3lfxvM
](https://groups.google.com/a/rethinkrobotics.com/forum/#!topic/brr-
users/QWITm3lfxvM) , thanks!


[ ↂ
](////adverbs45.rssing.com/chan-14763103/article227.html#c14763103a227i286089440
"Frequency Adverbs")


###  [ Murder in Australia: 2010
](////murder540.rssing.com/chan-6412619/article1.html#c6412619a1i1155785771)


    01153       // Get inertial rates
    01154       gazebo::Vector3 body_vpos = body->GetWorldLinearVel(); // get velocity in gazebo frame
    01155       gazebo::Vector3 body_veul = body->GetWorldAngularVel(); // get velocity in gazebo frame
    01156
    01157       if (frame)
    01158       {
    01159         // convert to relative pose
    01160         gazebo::Pose3d frame_pose = frame->GetWorldPose();
    01161         body_pose.pos = body_pose.pos - frame_pose.pos;
    01162         body_pose.pos = frame_pose.rot.RotateVectorReverse(body_pose.pos);
    01163         body_pose.rot *= frame_pose.rot.GetInverse();
    01164
    01165         // convert to relative rates
    01166         gazebo::Vector3 frame_vpos = frame->GetWorldLinearVel(); // get velocity in gazebo frame
    01167         gazebo::Vector3 frame_veul = frame->GetWorldAngularVel(); // get velocity in gazebo frame
    01168         body_vpos = frame_pose.rot.RotateVector(body_vpos - frame_vpos);
    01169         body_veul = frame_pose.rot.RotateVector(body_veul - frame_veul);
    01170       }
    01172       else if (req.[reference_frame](../../gazebo_msgs/html/structgazebo__msgs_1_1GetLinkStateRequest__.html#a83af84cb417fc8e9297c12f514a2be53) == "" || req.[reference_frame](../../gazebo_msgs/html/structgazebo__msgs_1_1GetLinkStateRequest__.html#a83af84cb417fc8e9297c12f514a2be53) == "world" || req.[reference_frame](../../gazebo_msgs/html/structgazebo__msgs_1_1GetLinkStateRequest__.html#a83af84cb417fc8e9297c12f514a2be53) == "map" || req.[reference_frame](../../gazebo_msgs/html/structgazebo__msgs_1_1GetLinkStateRequest__.html#a83af84cb417fc8e9297c12f514a2be53) == "/map")
    01173       {
    01174           [ROS_DEBUG](../../../api/rosconsole/html/macros__generated_8h.html#a83228c0b42c80605abdd0f42af64b1f7)("GetLinkState: reference_frame is empty/world/map, using inertial frame");
    01175       }
    01176       else
    01177       {
    01178         res.[success](../../gazebo_msgs/html/structgazebo__msgs_1_1GetLinkStateResponse__.html#ab078790cbd3b85968631041914f263eb) = false;
    01179         res.[status_message](../../gazebo_msgs/html/structgazebo__msgs_1_1GetLinkStateResponse__.html#ae6630d81e448f045256efffe68e5b7bd) = "GetLinkState: reference reference_frame not found, did you forget to scope the link by model name?";
    01180         return false;
    01181       }
    01182
    01183       res.[link_state](../../gazebo_msgs/html/structgazebo__msgs_1_1GetLinkStateResponse__.html#aa83952af428b1a3732e0e19cc2a7353e).[link_name](../../gazebo_msgs/html/structgazebo__msgs_1_1LinkState__.html#afc22e7a217cbc73817640680884df2bd) = req.[link_name](../../gazebo_msgs/html/structgazebo__msgs_1_1GetLinkStateRequest__.html#a2c698b3773b198139f234c5c0a3d9dbb);
    01184       res.[link_state](../../gazebo_msgs/html/structgazebo__msgs_1_1GetLinkStateResponse__.html#aa83952af428b1a3732e0e19cc2a7353e).[pose](../../gazebo_msgs/html/structgazebo__msgs_1_1LinkState__.html#ae83d49b974df6e08f92c3e1c8870507b).[position](../../../api/geometry_msgs/html/structgeometry__msgs_1_1Pose__.html#a27067d1772d85a856b0e4ed4690a80b4).[x](../../../api/geometry_msgs/html/structgeometry__msgs_1_1Point__.html#acd9420e6916084b2a9c09019bfda1708) = body_pose.pos.x;
    01185       res.[link_state](../../gazebo_msgs/html/structgazebo__msgs_1_1GetLinkStateResponse__.html#aa83952af428b1a3732e0e19cc2a7353e).[pose](../../gazebo_msgs/html/structgazebo__msgs_1_1LinkState__.html#ae83d49b974df6e08f92c3e1c8870507b).[position](../../../api/geometry_msgs/html/structgeometry__msgs_1_1Pose__.html#a27067d1772d85a856b0e4ed4690a80b4).[y](../../../api/geometry_msgs/html/structgeometry__msgs_1_1Point__.html#a46a84ff5a3e5817ab5693abda66fccb0) = body_pose.pos.y;
    01186       res.[link_state](../../gazebo_msgs/html/structgazebo__msgs_1_1GetLinkStateResponse__.html#aa83952af428b1a3732e0e19cc2a7353e).[pose](../../gazebo_msgs/html/structgazebo__msgs_1_1LinkState__.html#ae83d49b974df6e08f92c3e1c8870507b).[position](../../../api/geometry_msgs/html/structgeometry__msgs_1_1Pose__.html#a27067d1772d85a856b0e4ed4690a80b4).[z](../../../api/geometry_msgs/html/structgeometry__msgs_1_1Point__.html#a061f0093e927a95998f35ceceb5cebda) = body_pose.pos.z;
    01187       res.[link_state](../../gazebo_msgs/html/structgazebo__msgs_1_1GetLinkStateResponse__.html#aa83952af428b1a3732e0e19cc2a7353e).[pose](../../gazebo_msgs/html/structgazebo__msgs_1_1LinkState__.html#ae83d49b974df6e08f92c3e1c8870507b).[orientation](../../../api/geometry_msgs/html/structgeometry__msgs_1_1Pose__.html#af8c1d34a44a7628ea9c3e571339f5a28).[x](../../../api/geometry_msgs/html/structgeometry__msgs_1_1Quaternion__.html#a11f3b4e2df587ce516fd2a8140c1c7c5) = body_pose.rot.x;
    01188       res.[link_state](../../gazebo_msgs/html/structgazebo__msgs_1_1GetLinkStateResponse__.html#aa83952af428b1a3732e0e19cc2a7353e).[pose](../../gazebo_msgs/html/structgazebo__msgs_1_1LinkState__.html#ae83d49b974df6e08f92c3e1c8870507b).[orientation](../../../api/geometry_msgs/html/structgeometry__msgs_1_1Pose__.html#af8c1d34a44a7628ea9c3e571339f5a28).[y](../../../api/geometry_msgs/html/structgeometry__msgs_1_1Quaternion__.html#a601c978178311ce3a618afb38c0b6b98) = body_pose.rot.y;
    01189       res.[link_state](../../gazebo_msgs/html/structgazebo__msgs_1_1GetLinkStateResponse__.html#aa83952af428b1a3732e0e19cc2a7353e).[pose](../../gazebo_msgs/html/structgazebo__msgs_1_1LinkState__.html#ae83d49b974df6e08f92c3e1c8870507b).[orientation](../../../api/geometry_msgs/html/structgeometry__msgs_1_1Pose__.html#af8c1d34a44a7628ea9c3e571339f5a28).[z](../../../api/geometry_msgs/html/structgeometry__msgs_1_1Quaternion__.html#ae2caceb9fc4b2fd01acd8419aa7ebc2e) = body_pose.rot.z;
    01190       res.[link_state](../../gazebo_msgs/html/structgazebo__msgs_1_1GetLinkStateResponse__.html#aa83952af428b1a3732e0e19cc2a7353e).[pose](../../gazebo_msgs/html/structgazebo__msgs_1_1LinkState__.html#ae83d49b974df6e08f92c3e1c8870507b).[orientation](../../../api/geometry_msgs/html/structgeometry__msgs_1_1Pose__.html#af8c1d34a44a7628ea9c3e571339f5a28).[w](../../../api/geometry_msgs/html/structgeometry__msgs_1_1Quaternion__.html#a440791d268a65607ecbac21e0ed153cf) = body_pose.rot.u;
    01191       res.[link_state](../../gazebo_msgs/html/structgazebo__msgs_1_1GetLinkStateResponse__.html#aa83952af428b1a3732e0e19cc2a7353e).[twist](../../gazebo_msgs/html/structgazebo__msgs_1_1LinkState__.html#aacdf4d3b28003c05951526d13a1c57f8).[linear](../../../api/geometry_msgs/html/structgeometry__msgs_1_1Twist__.html#a394500332ac20028528c37103e1bf8e5).[x](../../../api/geometry_msgs/html/structgeometry__msgs_1_1Vector3__.html#abf9dabaf651196aee50fd14bf3b643be) = body_vpos.x;
    01192       res.[link_state](../../gazebo_msgs/html/structgazebo__msgs_1_1GetLinkStateResponse__.html#aa83952af428b1a3732e0e19cc2a7353e).[twist](../../gazebo_msgs/html/structgazebo__msgs_1_1LinkState__.html#aacdf4d3b28003c05951526d13a1c57f8).[linear](../../../api/geometry_msgs/html/structgeometry__msgs_1_1Twist__.html#a394500332ac20028528c37103e1bf8e5).[y](../../../api/geometry_msgs/html/structgeometry__msgs_1_1Vector3__.html#aaea58ad929c43960a06f728d97132404) = body_vpos.y;
    01193       res.[link_state](../../gazebo_msgs/html/structgazebo__msgs_1_1GetLinkStateResponse__.html#aa83952af428b1a3732e0e19cc2a7353e).[twist](../../gazebo_msgs/html/structgazebo__msgs_1_1LinkState__.html#aacdf4d3b28003c05951526d13a1c57f8).[linear](../../../api/geometry_msgs/html/structgeometry__msgs_1_1Twist__.html#a394500332ac20028528c37103e1bf8e5).[z](../../../api/geometry_msgs/html/structgeometry__msgs_1_1Vector3__.html#a4cde719326e6c3688ab50b51ab4708b1) = body_vpos.z;


* [ The ReadME Project  GitHub community articles  ](/readme)


    <run_depend>gazebo_ros</run_depend>
    <export>
      <gazebo_ros gazebo_model_path="${prefix}/models"/>
      <gazebo_ros gazebo_media_path="${prefix}/models"/>
    </export>


Password


[ ](javascript:; "Like") 0


Projects


      <arg name="paused" default="true" doc="Starts gazebo in paused mode" />

      <include file="$(find gazebo_ros)/launch/empty_world.launch">
        <arg name="world_name" default="worlds/empty.world"/>
        <arg name="paused" value="$(arg paused)"/>
        <arg name="gui" value="$(arg gui)"/>
      </include>

      <node name="spawn_gazebo_model" pkg="gazebo_ros" type="spawn_model" args="-urdf -param robot_description -model robot
                  -z 0.0
                  -J shoulder_lift_joint -1.57
                  -J elbow_joint 1.001
                  -unpause
                  " respawn="false" output="screen" />


    <?xml version="1.0" ?>
    <sdf version="1.4">
      <world name="default">
        <include>
          <uri>model://ground_plane</uri>
        </include>
        <include>
          <uri>model://sun</uri>
        </include>
        <include>
          <uri>model://gas_station</uri>
          <name>gas_station</name>
          <pose>-2.0 7.0 0 0 0 0</pose>
        </include>
      </world>
    </sdf>


[ Search ](javascript:;)


  * [ Tutorials ](/tutorials)
  * [ Download ](/download)
  * [ Blog ](/blog.html)
  * [ Media ](/media)
  * [ Projects ](/projects)


rosservice call /gazebo/set_model_configuration '{ model_name: "baxter", urdf_param_name: "robot_description", joint_names: [ "right_s0", "right_s1", "right_e0", "right_e1", "right_w0", "right_w1", "right_w2", "left_s0", "left_s1", "left_e0", "left_e1", "left_w0", "left_w1", "left_w2" ], joint_positions: [ -0.272659, 1.04701, -0.00123203, 0.49262, -0.0806423, -0.0620532, 0.0265941, 0.192483, 1.047, 0.000806359, 0.491094, -0.178079, -0.0610333, -0.0124707 ] }'


[ _≫_ Next: Can I apply zero gravity on .urdf models?
](//gazebo214.rssing.com/chan-57893035/latest.php#c57893035a6933 "Next
Article")


Sorry, something went wrong.


**[ DangMinh24 ](/DangMinh24) ** commented  Nov 16, 2022


Copy link


![Wondershare PDFelement v7.x.x Patch v3.4 By
Deltafox](//i.imgur.com/u8v9Ga1.jpg)


    01111         res.[mass](../../gazebo_msgs/html/structgazebo__msgs_1_1GetLinkPropertiesResponse__.html#abe7ecae2d26767aa83a516ed43f320be) = body->GetMass().GetAsDouble();
    01112
    01113         gazebo::Vector3 principalI = body->GetMass().GetPrincipalMoments();
    01114         gazebo::Vector3 productI = body->GetMass().GetProductsofInertia();
    01115         res.[ixx](../../gazebo_msgs/html/structgazebo__msgs_1_1GetLinkPropertiesResponse__.html#a693e256ee64465731f334f9586189835) = principalI.x;
    01116         res.[iyy](../../gazebo_msgs/html/structgazebo__msgs_1_1GetLinkPropertiesResponse__.html#a8c09a50b176d466c122750c1a1f6c534) = principalI.y;
    01117         res.[izz](../../gazebo_msgs/html/structgazebo__msgs_1_1GetLinkPropertiesResponse__.html#aec9283fb378580adf59f415f71567130) = principalI.z;
    01118         res.[ixy](../../gazebo_msgs/html/structgazebo__msgs_1_1GetLinkPropertiesResponse__.html#a53b2ac8712e9f23ef85d931bbec6e1db) = productI.x;
    01119         res.[ixz](../../gazebo_msgs/html/structgazebo__msgs_1_1GetLinkPropertiesResponse__.html#a9f7f4b49278f39123fff78ba32cd553a) = productI.y;
    01120         res.[iyz](../../gazebo_msgs/html/structgazebo__msgs_1_1GetLinkPropertiesResponse__.html#adedb524e8ecd8bad50e8ee44e696e65f) = productI.z;
    01121
    01122         gazebo::Vector3 com = body->GetMass().GetCoG();
    01123         res.[com](../../gazebo_msgs/html/structgazebo__msgs_1_1GetLinkPropertiesResponse__.html#afcb11f89b56db057dfde28788215c405).[position](../../../api/geometry_msgs/html/structgeometry__msgs_1_1Pose__.html#a27067d1772d85a856b0e4ed4690a80b4).[x](../../../api/geometry_msgs/html/structgeometry__msgs_1_1Point__.html#acd9420e6916084b2a9c09019bfda1708) = com.x;
    01124         res.[com](../../gazebo_msgs/html/structgazebo__msgs_1_1GetLinkPropertiesResponse__.html#afcb11f89b56db057dfde28788215c405).[position](../../../api/geometry_msgs/html/structgeometry__msgs_1_1Pose__.html#a27067d1772d85a856b0e4ed4690a80b4).[y](../../../api/geometry_msgs/html/structgeometry__msgs_1_1Point__.html#a46a84ff5a3e5817ab5693abda66fccb0) = com.y;
    01125         res.[com](../../gazebo_msgs/html/structgazebo__msgs_1_1GetLinkPropertiesResponse__.html#afcb11f89b56db057dfde28788215c405).[position](../../../api/geometry_msgs/html/structgeometry__msgs_1_1Pose__.html#a27067d1772d85a856b0e4ed4690a80b4).[z](../../../api/geometry_msgs/html/structgeometry__msgs_1_1Point__.html#a061f0093e927a95998f35ceceb5cebda) = com.z;
    01126         res.[com](../../gazebo_msgs/html/structgazebo__msgs_1_1GetLinkPropertiesResponse__.html#afcb11f89b56db057dfde28788215c405).[orientation](../../../api/geometry_msgs/html/structgeometry__msgs_1_1Pose__.html#af8c1d34a44a7628ea9c3e571339f5a28).[x](../../../api/geometry_msgs/html/structgeometry__msgs_1_1Quaternion__.html#a11f3b4e2df587ce516fd2a8140c1c7c5) = 0; // @todo: gazebo do not support rotated inertia yet
    01127         res.[com](../../gazebo_msgs/html/structgazebo__msgs_1_1GetLinkPropertiesResponse__.html#afcb11f89b56db057dfde28788215c405).[orientation](../../../api/geometry_msgs/html/structgeometry__msgs_1_1Pose__.html#af8c1d34a44a7628ea9c3e571339f5a28).[y](../../../api/geometry_msgs/html/structgeometry__msgs_1_1Quaternion__.html#a601c978178311ce3a618afb38c0b6b98) = 0;
    01128         res.[com](../../gazebo_msgs/html/structgazebo__msgs_1_1GetLinkPropertiesResponse__.html#afcb11f89b56db057dfde28788215c405).[orientation](../../../api/geometry_msgs/html/structgeometry__msgs_1_1Pose__.html#af8c1d34a44a7628ea9c3e571339f5a28).[z](../../../api/geometry_msgs/html/structgeometry__msgs_1_1Quaternion__.html#ae2caceb9fc4b2fd01acd8419aa7ebc2e) = 0;
    01129         res.[com](../../gazebo_msgs/html/structgazebo__msgs_1_1GetLinkPropertiesResponse__.html#afcb11f89b56db057dfde28788215c405).[orientation](../../../api/geometry_msgs/html/structgeometry__msgs_1_1Pose__.html#af8c1d34a44a7628ea9c3e571339f5a28).[w](../../../api/geometry_msgs/html/structgeometry__msgs_1_1Quaternion__.html#a440791d268a65607ecbac21e0ed153cf) = 1;
    01130
    01131         res.[success](../../gazebo_msgs/html/structgazebo__msgs_1_1GetLinkPropertiesResponse__.html#a84ce8f4df675b6924cfa52a366663e5f) = true;
    01132         res.[status_message](../../gazebo_msgs/html/structgazebo__msgs_1_1GetLinkPropertiesResponse__.html#a70abfa0b58777c634a35301a549dcc0e) = "GetLinkProperties: got properties";
    01133         return true;
    01134       }
    01135       return true;
    01136     }
    01137
    [01140](classGazeboROSNode.html#af0eae1e0c329412d822c8c72e9f60b3e)     bool [getLinkState](classGazeboROSNode.html#af0eae1e0c329412d822c8c72e9f60b3e)([gazebo_msgs::GetLinkState::Request](../../gazebo_msgs/html/structgazebo__msgs_1_1GetLinkStateRequest__.html) &req,[gazebo_msgs::GetLinkState::Response](../../gazebo_msgs/html/structgazebo__msgs_1_1GetLinkStateResponse__.html) &res)
    01141     {
    01142       gazebo::Body* body = dynamic_cast<gazebo::Body*>(gazebo::World::Instance()->GetEntityByName(req.[link_name](../../gazebo_msgs/html/structgazebo__msgs_1_1GetLinkStateRequest__.html#a2c698b3773b198139f234c5c0a3d9dbb)));
    01143       gazebo::Body* frame = dynamic_cast<gazebo::Body*>(gazebo::World::Instance()->GetEntityByName(req.[reference_frame](../../gazebo_msgs/html/structgazebo__msgs_1_1GetLinkStateRequest__.html#a83af84cb417fc8e9297c12f514a2be53)));
    01144       if (body == NULL)
    01145       {
    01146         res.[success](../../gazebo_msgs/html/structgazebo__msgs_1_1GetLinkStateResponse__.html#ab078790cbd3b85968631041914f263eb) = false;
    01147         res.[status_message](../../gazebo_msgs/html/structgazebo__msgs_1_1GetLinkStateResponse__.html#ae6630d81e448f045256efffe68e5b7bd) = "GetLinkState: link not found, did you forget to scope the link by model name?";
    01148         return false;
    01149       }
    01150
    01151       // get body pose
    01152       gazebo::Pose3d body_pose = body->GetWorldPose();


[ ![@the-raspberry-pi-
guy](https://avatars.githubusercontent.com/u/5570173?s=80&u=c32744a19ef2b7158431c7a1948822887de75fa5&v=4)
](/the-raspberry-pi-guy)


You should see the following world model (zoom out with the scroll wheel on
your mouse):


**[ m-talha ](/m-talha) ** commented  Aug 29, 2019


[ Go to the documentation of this file. ](gazeboros_8cpp.html)


Also w.r.t. [ ` 99b9dc5 ` ](https://github.com/ros-
simulation/gazebo_ros_pkgs/commit/99b9dc598413ab37f6d5f7e67b005f195d88ccdc) ,
it doesn't always work.

---

All reactions


  * [ Contact Us  ](//www.rssing.com/contact.php)
    * [ Technical Support ](//www.rssing.com/contact.php)
    * [ Guest Posts/Articles ](//www.rssing.com/contact.php?r=o9)
    * [ Report Violations ](//www.rssing.com/contact.php)
    * [ Google Warnings ](//www.rssing.com/contact.php?r=o4)
    * [ Article Removal Requests ](//www.rssing.com/contact.php?r=o5_0)
    * [ Channel Removal Requests ](//www.rssing.com/contact.php?r=o5_0)
    * [ General Questions ](//www.rssing.com/contact.php?r=o8)
    * [ DMCA Takedown Notice ](//www.rssing.com/contact.php)


I find it hysterical 8 years later a bug like this still exists lmao.

---

All reactions


After running my launch file I got this error: gazebo has problem INFO]
[1690533387.960548, 0.695000]: Controller Spawner: Loaded controllers:
joint_state_controller, robot_arm_controller, hand_ee_controller Segmentation
fault (core dumped) [gazebo-1] process has died [pid 3631, exit code 139, cmd
/opt/ros/noetic/lib/gazebo_ros/gzserver -e ode worlds/empty.world
__name:=gazebo
__log:=/home/jainvrushab5/.ros/log/a73a9b62-2d21-11ee-b79a-1b66b09d8dc9/gazebo-1.log].
log file:
/home/jainvrushab5/.ros/log/a73a9b62-2d21-11ee-b79a-1b66b09d8dc9/gazebo-1*.log
WARN] [1690533389.220244, 0.699000]: Controller Spawner error while taking
down controllers: unable to connect to service: [Errno 111] Connection refused
[controller_spawner-5] process has died [pid 3643, exit code 1, cmd
/opt/ros/noetic/lib/controller_manager/spawner joint_state_controller
robot_arm_controller hand_ee_controller __name:=controller_spawner
__log:=/home/jainvrushab5/.ros/log/a73a9b62-2d21-11ee-b79a-1b66b09d8dc9/controller_spawner-5.log].
log file:
/home/jainvrushab5/.ros/log/a73a9b62-2d21-11ee-b79a-1b66b09d8dc9/controller_spawner-5*.log
My launch File :  Ubuntu 20.04 ROS Noetic Gazebo multi-robot simulator,
version 11.11.0


[ _≫_ Next: How to generate a 3D occupancy map for a Gazebo world
](//gazebo214.rssing.com/chan-57893035/latest.php#c57893035a6930 "Next
Article")


[
![@fmessmer](https://avatars.githubusercontent.com/u/508006?s=80&u=34cff5e25c579c359ad4f4b566fbc425f1b353e5&v=4)
](/fmessmer)


file::/EntityTree/EntityTree.qml:148:7: QML ToolButton: Detected anchors on an
item that is managed by a layout. This is undefined behavior; use
Layout.alignment instead. [GUI] [Wrn] [Application.cc:797] [QT]
file::/WorldStats/WorldStats.qml:53:3: QML RowLayout: Binding loop detected
for property "x" [GUI] [Wrn] [Application.cc:797] [QT]
file::/EntityContextMenuPlugin/EntityContextMenuPlugin.qml:52:3: QML
RenderWindowOverlay: Detected anchors on an item that is managed by a layout.
This is undefined behavior; use Layout.alignment instead. [GUI] [Wrn]
[Application.cc:797] [QT]
file::/EntityContextMenuPlugin/EntityContextMenuPlugin.qml:67:3: QML
EntityContextMenu: Detected anchors on an item that is managed by a layout.
This is undefined behavior; use Layout.alignment instead. [GUI] [Msg] Loading
plugin [ignition-rendering-ogre2] [GUI] [Dbg] [MinimalScene.cc:560] Create
scene [scene] [GUI] [Msg] Loading plugin [ignition-rendering-ogre2] [GUI]
[Dbg] [TransformControl.cc:528] TransformControl plugin is using camera
[scene::Camera(65527)] [GUI] [Msg] Loading plugin [ignition-rendering-ogre2]
[GUI] [Msg] Loading plugin [ignition-rendering-ogre2] [GUI] [Dbg]
[Spawn.cc:289] Spawn plugin is using camera [scene::Camera(65527)] [GUI] [Msg]
Loading plugin [ignition-rendering-ogre2] [GUI] [Dbg] [SelectEntities.cc:451]
SelectEntities plugin is using camera [scene::Camera(65527)] [GUI] [Msg]
Loading plugin [ignition-rendering-ogre2] [GUI] [Dbg] [MarkerManager.cc:173]
Advertise /marker/list service. [GUI] [Dbg] [MarkerManager.cc:183] Advertise
/marker/list. [GUI] [Dbg] [MarkerManager.cc:193] Advertise /marker_array.
[GUI] [Msg] Loading plugin [ignition-rendering-ogre2] [GUI] [Dbg]
[CameraTracking.cc:181] CameraTrackingPrivate plugin is moving camera
[scene::Camera(65527)] [GUI] [Msg] Move to service on [/gui/move_to] [GUI]
[Msg] Follow service on [/gui/follow] [GUI] [Msg] Move to pose service on
[/gui/move_to/pose] [GUI] [Msg] Camera pose topic advertised on
[/gui/camera/pose] [GUI] [Msg] Follow offset service on [/gui/follow/offset]
[GUI] [Msg] Loading plugin [ignition-rendering-ogre2] [GUI] [Dbg]
[InteractiveViewControl.cc:130] InteractiveViewControl plugin is moving camera
[scene::Camera(65527)] [GUI] [Msg] Loading plugin [ignition-rendering-ogre2]
[GUI] [Msg] Loading plugin [ignition-rendering-ogre2] [GUI] [Dbg]
[EntityContextMenuPlugin.cc:79] Entity context menu plugin is using camera
[scene::Camera(65527)] [Msg] Found no publishers on /stats, adding root stats
topic [Msg] Found no publishers on /clock, adding root clock topic [Dbg]
[SimulationRunner.cc:491] Creating PostUpdate worker threads: 2 [Dbg]
[SimulationRunner.cc:502] Creating postupdate worker thread (0) [Msg] Serving
scene information on [/world/default/scene/info] [Msg] Serving graph
information on [/world/default/scene/graph] [Msg] Serving full state on


    01826
    [01829](classGazeboROSNode.html#a885a6f43b990036c7625cf50a06113fb)     bool [setLinkState](classGazeboROSNode.html#a885a6f43b990036c7625cf50a06113fb)([gazebo_msgs::SetLinkState::Request](../../gazebo_msgs/html/structgazebo__msgs_1_1SetLinkStateRequest__.html) &req,[gazebo_msgs::SetLinkState::Response](../../gazebo_msgs/html/structgazebo__msgs_1_1SetLinkStateResponse__.html) &res)
    01830     {
    01831       gazebo::Body* body = dynamic_cast<gazebo::Body*>(gazebo::World::Instance()->GetEntityByName(req.[link_state](../../gazebo_msgs/html/structgazebo__msgs_1_1SetLinkStateRequest__.html#ae59381a6d7c1fd2dea5f4189a4f118fe).[link_name](../../gazebo_msgs/html/structgazebo__msgs_1_1LinkState__.html#afc22e7a217cbc73817640680884df2bd)));
    01832       gazebo::Body* frame = dynamic_cast<gazebo::Body*>(gazebo::World::Instance()->GetEntityByName(req.[link_state](../../gazebo_msgs/html/structgazebo__msgs_1_1SetLinkStateRequest__.html#ae59381a6d7c1fd2dea5f4189a4f118fe).[reference_frame](../../gazebo_msgs/html/structgazebo__msgs_1_1LinkState__.html#af3c75584cb85e20e4bac931829d8a80e)));
    01833       if (!body)
    01834       {
    01835         [ROS_ERROR](../../../api/rosconsole/html/macros__generated_8h.html#a7fb635b03cc608284eadecd2f8becd9a)("SetLinkState: link [%s] does not exist",req.[link_state](../../gazebo_msgs/html/structgazebo__msgs_1_1SetLinkStateRequest__.html#ae59381a6d7c1fd2dea5f4189a4f118fe).[link_name](../../gazebo_msgs/html/structgazebo__msgs_1_1LinkState__.html#afc22e7a217cbc73817640680884df2bd).c_str());
    01836         res.[success](../../gazebo_msgs/html/structgazebo__msgs_1_1SetLinkStateResponse__.html#a9ddd44a499fd3f5e117637729474e969) = false;
    01837         res.[status_message](../../gazebo_msgs/html/structgazebo__msgs_1_1SetLinkStateResponse__.html#a599d42bb7063ff3f9139767cd62f3c10) = "SetLinkState: link does not exist";
    01838         return false;
    01839       }
    01840
    01842       // get reference frame (body/model(link)) pose and
    01843       // transform target pose to absolute world frame
    01844       gazebo::Vector3 target_pos(req.[link_state](../../gazebo_msgs/html/structgazebo__msgs_1_1SetLinkStateRequest__.html#ae59381a6d7c1fd2dea5f4189a4f118fe).[pose](../../gazebo_msgs/html/structgazebo__msgs_1_1LinkState__.html#ae83d49b974df6e08f92c3e1c8870507b).[position](../../../api/geometry_msgs/html/structgeometry__msgs_1_1Pose__.html#a27067d1772d85a856b0e4ed4690a80b4).[x](../../../api/geometry_msgs/html/structgeometry__msgs_1_1Point__.html#acd9420e6916084b2a9c09019bfda1708),req.[link_state](../../gazebo_msgs/html/structgazebo__msgs_1_1SetLinkStateRequest__.html#ae59381a6d7c1fd2dea5f4189a4f118fe).[pose](../../gazebo_msgs/html/structgazebo__msgs_1_1LinkState__.html#ae83d49b974df6e08f92c3e1c8870507b).[position](../../../api/geometry_msgs/html/structgeometry__msgs_1_1Pose__.html#a27067d1772d85a856b0e4ed4690a80b4).[y](../../../api/geometry_msgs/html/structgeometry__msgs_1_1Point__.html#a46a84ff5a3e5817ab5693abda66fccb0),req.[link_state](../../gazebo_msgs/html/structgazebo__msgs_1_1SetLinkStateRequest__.html#ae59381a6d7c1fd2dea5f4189a4f118fe).[pose](../../gazebo_msgs/html/structgazebo__msgs_1_1LinkState__.html#ae83d49b974df6e08f92c3e1c8870507b).[position](../../../api/geometry_msgs/html/structgeometry__msgs_1_1Pose__.html#a27067d1772d85a856b0e4ed4690a80b4).[z](../../../api/geometry_msgs/html/structgeometry__msgs_1_1Point__.html#a061f0093e927a95998f35ceceb5cebda));
    01845       gazebo::Quatern target_rot(req.[link_state](../../gazebo_msgs/html/structgazebo__msgs_1_1SetLinkStateRequest__.html#ae59381a6d7c1fd2dea5f4189a4f118fe).[pose](../../gazebo_msgs/html/structgazebo__msgs_1_1LinkState__.html#ae83d49b974df6e08f92c3e1c8870507b).[orientation](../../../api/geometry_msgs/html/structgeometry__msgs_1_1Pose__.html#af8c1d34a44a7628ea9c3e571339f5a28).[w](../../../api/geometry_msgs/html/structgeometry__msgs_1_1Quaternion__.html#a440791d268a65607ecbac21e0ed153cf),req.[link_state](../../gazebo_msgs/html/structgazebo__msgs_1_1SetLinkStateRequest__.html#ae59381a6d7c1fd2dea5f4189a4f118fe).[pose](../../gazebo_msgs/html/structgazebo__msgs_1_1LinkState__.html#ae83d49b974df6e08f92c3e1c8870507b).[orientation](../../../api/geometry_msgs/html/structgeometry__msgs_1_1Pose__.html#af8c1d34a44a7628ea9c3e571339f5a28).[x](../../../api/geometry_msgs/html/structgeometry__msgs_1_1Quaternion__.html#a11f3b4e2df587ce516fd2a8140c1c7c5),req.[link_state](../../gazebo_msgs/html/structgazebo__msgs_1_1SetLinkStateRequest__.html#ae59381a6d7c1fd2dea5f4189a4f118fe).[pose](../../gazebo_msgs/html/structgazebo__msgs_1_1LinkState__.html#ae83d49b974df6e08f92c3e1c8870507b).[orientation](../../../api/geometry_msgs/html/structgeometry__msgs_1_1Pose__.html#af8c1d34a44a7628ea9c3e571339f5a28).[y](../../../api/geometry_msgs/html/structgeometry__msgs_1_1Quaternion__.html#a601c978178311ce3a618afb38c0b6b98),req.[link_state](../../gazebo_msgs/html/structgazebo__msgs_1_1SetLinkStateRequest__.html#ae59381a6d7c1fd2dea5f4189a4f118fe).[pose](../../gazebo_msgs/html/structgazebo__msgs_1_1LinkState__.html#ae83d49b974df6e08f92c3e1c8870507b).[orientation](../../../api/geometry_msgs/html/structgeometry__msgs_1_1Pose__.html#af8c1d34a44a7628ea9c3e571339f5a28).[z](../../../api/geometry_msgs/html/structgeometry__msgs_1_1Quaternion__.html#ae2caceb9fc4b2fd01acd8419aa7ebc2e));
    01846       gazebo::Pose3d target_pose(target_pos,target_rot);
    01847       gazebo::Vector3 target_linear_vel(req.[link_state](../../gazebo_msgs/html/structgazebo__msgs_1_1SetLinkStateRequest__.html#ae59381a6d7c1fd2dea5f4189a4f118fe).[twist](../../gazebo_msgs/html/structgazebo__msgs_1_1LinkState__.html#aacdf4d3b28003c05951526d13a1c57f8).[linear](../../../api/geometry_msgs/html/structgeometry__msgs_1_1Twist__.html#a394500332ac20028528c37103e1bf8e5).[x](../../../api/geometry_msgs/html/structgeometry__msgs_1_1Vector3__.html#abf9dabaf651196aee50fd14bf3b643be),req.[link_state](../../gazebo_msgs/html/structgazebo__msgs_1_1SetLinkStateRequest__.html#ae59381a6d7c1fd2dea5f4189a4f118fe).[twist](../../gazebo_msgs/html/structgazebo__msgs_1_1LinkState__.html#aacdf4d3b28003c05951526d13a1c57f8).[linear](../../../api/geometry_msgs/html/structgeometry__msgs_1_1Twist__.html#a394500332ac20028528c37103e1bf8e5).[y](../../../api/geometry_msgs/html/structgeometry__msgs_1_1Vector3__.html#aaea58ad929c43960a06f728d97132404),req.[link_state](../../gazebo_msgs/html/structgazebo__msgs_1_1SetLinkStateRequest__.html#ae59381a6d7c1fd2dea5f4189a4f118fe).[twist](../../gazebo_msgs/html/structgazebo__msgs_1_1LinkState__.html#aacdf4d3b28003c05951526d13a1c57f8).[linear](../../../api/geometry_msgs/html/structgeometry__msgs_1_1Twist__.html#a394500332ac20028528c37103e1bf8e5).[z](../../../api/geometry_msgs/html/structgeometry__msgs_1_1Vector3__.html#a4cde719326e6c3688ab50b51ab4708b1));
    01848       gazebo::Vector3 target_angular_vel(req.[link_state](../../gazebo_msgs/html/structgazebo__msgs_1_1SetLinkStateRequest__.html#ae59381a6d7c1fd2dea5f4189a4f118fe).[twist](../../gazebo_msgs/html/structgazebo__msgs_1_1LinkState__.html#aacdf4d3b28003c05951526d13a1c57f8).[angular](../../../api/geometry_msgs/html/structgeometry__msgs_1_1Twist__.html#aa0cb518e509179290aa793228ef01f6b).[x](../../../api/geometry_msgs/html/structgeometry__msgs_1_1Vector3__.html#abf9dabaf651196aee50fd14bf3b643be),req.[link_state](../../gazebo_msgs/html/structgazebo__msgs_1_1SetLinkStateRequest__.html#ae59381a6d7c1fd2dea5f4189a4f118fe).[twist](../../gazebo_msgs/html/structgazebo__msgs_1_1LinkState__.html#aacdf4d3b28003c05951526d13a1c57f8).[angular](../../../api/geometry_msgs/html/structgeometry__msgs_1_1Twist__.html#aa0cb518e509179290aa793228ef01f6b).[y](../../../api/geometry_msgs/html/structgeometry__msgs_1_1Vector3__.html#aaea58ad929c43960a06f728d97132404),req.[link_state](../../gazebo_msgs/html/structgazebo__msgs_1_1SetLinkStateRequest__.html#ae59381a6d7c1fd2dea5f4189a4f118fe).[twist](../../gazebo_msgs/html/structgazebo__msgs_1_1LinkState__.html#aacdf4d3b28003c05951526d13a1c57f8).[angular](../../../api/geometry_msgs/html/structgeometry__msgs_1_1Twist__.html#aa0cb518e509179290aa793228ef01f6b).[z](../../../api/geometry_msgs/html/structgeometry__msgs_1_1Vector3__.html#a4cde719326e6c3688ab50b51ab4708b1));
    01849
    01850       if (frame)
    01851       {
    01852         gazebo::Pose3d  frame_pose = frame->GetWorldPose(); // - this->myBody->GetCoMPose();
    01853         gazebo::Vector3 frame_pos = frame_pose.pos;
    01854         gazebo::Quatern frame_rot = frame_pose.rot;
    01855
    01856         //std::cout << " debug : " << frame->GetName() << " : " << frame_pose << " : " << target_pose << std::endl;
    01857         //target_pose = frame_pose + target_pose; // seems buggy, use my own
    01858         target_pose.pos = frame_pos + frame_rot.RotateVector(target_pos);
    01859         target_pose.rot = frame_rot * target_pose.rot;
    01860
    01861         gazebo::Vector3 frame_linear_vel = frame->GetWorldLinearVel();
    01862         gazebo::Vector3 frame_angular_vel = frame->GetWorldAngularVel();
    01863         target_linear_vel -= frame_linear_vel;
    01864         target_angular_vel -= frame_angular_vel;
    01865       }
    01866       else if (req.[link_state](../../gazebo_msgs/html/structgazebo__msgs_1_1SetLinkStateRequest__.html#ae59381a6d7c1fd2dea5f4189a4f118fe).[reference_frame](../../gazebo_msgs/html/structgazebo__msgs_1_1LinkState__.html#af3c75584cb85e20e4bac931829d8a80e) == "" || req.[link_state](../../gazebo_msgs/html/structgazebo__msgs_1_1SetLinkStateRequest__.html#ae59381a6d7c1fd2dea5f4189a4f118fe).[reference_frame](../../gazebo_msgs/html/structgazebo__msgs_1_1LinkState__.html#af3c75584cb85e20e4bac931829d8a80e) == "world" || req.[link_state](../../gazebo_msgs/html/structgazebo__msgs_1_1SetLinkStateRequest__.html#ae59381a6d7c1fd2dea5f4189a4f118fe).[reference_frame](../../gazebo_msgs/html/structgazebo__msgs_1_1LinkState__.html#af3c75584cb85e20e4bac931829d8a80e) == "map" || req.[link_state](../../gazebo_msgs/html/structgazebo__msgs_1_1SetLinkStateRequest__.html#ae59381a6d7c1fd2dea5f4189a4f118fe).[reference_frame](../../gazebo_msgs/html/structgazebo__msgs_1_1LinkState__.html#af3c75584cb85e20e4bac931829d8a80e) == "/map")
    01867       {
    01868         [ROS_INFO](../../../api/rosconsole/html/macros__generated_8h.html#a20d5da22f16df09d52a7577227636a83)("SetLinkState: reference_frame is empty/world/map, using inertial frame");


    <!-- Convert an xacro and put on parameter server -->
    <param name="robot_description" command="$(find xacro)/xacro.py $(find pr2_description)/robots/pr2.urdf.xacro" />

    <!-- Spawn a robot into Gazebo -->
    <node name="spawn_urdf" pkg="gazebo_ros" type="spawn_model" args="-param robot_description -urdf -model pr2" />


[ ↂ
](////hullabaloo16.rssing.com/chan-9145637/article818.html#c9145637a818i695428444
"Calgary Hells Angels implicated in another fraud")


Sorry, something went wrong.


All reactions


We will go over both methods. Overall our recommended method is using the
'''ROS Service Call Spawn Method'''


    00283   {
    00284     nodes.clear();
    00285     ros::master::getNodes(nodes);
    00286     ROS_DEBUG("Trying to shutdown nicely, [%d] nodes still alive, waiting...",(int)nodes.size());
    00287     for (ros::V_string::iterator it = nodes.begin(); it != nodes.end(); it++)
    00288     {
    00289       ROS_DEBUG("    node[%d]: [%s]",(int)nodes.size(),it->c_str());
    00290       usleep(100000);
    00291     }
    00292
    00293   }
    00294   ROS_DEBUG("Stopping gazebo");
    00295   */
    00296
    00297   //TODO: use a boost::signal
    00298   gazebo::Simulator::Instance()->SetUserQuit();
    00299   return;
    00300 }
    00301
    00302
    [00303](classGazeboROSNode.html) class [GazeboROSNode](classGazeboROSNode.html)
    00304 {
    00305   public:
    [00306](classGazeboROSNode.html#a14766ec5f2f7d87e33b21ced7895fd13)     [GazeboROSNode](classGazeboROSNode.html#a14766ec5f2f7d87e33b21ced7895fd13)() : [rosnode_](classGazeboROSNode.html#ae9011736edb2ec542d7176cdddeb546d)("~")
    00307     {
    00308         [pub_gazebo_paused_](classGazeboROSNode.html#a5d3fe16d1240033b9bb04ef67bc24c9a) = this->[rosnode_](classGazeboROSNode.html#ae9011736edb2ec542d7176cdddeb546d).[advertise](../../../api/roscpp/html/classros_1_1NodeHandle.html#a68232c46583059c8f7d948b154689e4c)<std_msgs::Bool>("paused", 1, true);
    00309
    00311       this->[physics_reconfigure_initialized_](classGazeboROSNode.html#a2181c5f39b7ef9e85ef3382e53f66b40) = false;
    00312       this->[gazebo_callback_queue_thread_](classGazeboROSNode.html#a382ac60d7e343d5dc666c4cf3d399bf7) = new boost::thread( &[GazeboROSNode::gazeboQueueThread](classGazeboROSNode.html#ab7cc0342705dfac7b7aac77001ad3603 "ros queue thread for this node"),this );
    00313
    00315       this->[physics_reconfigure_thread_](classGazeboROSNode.html#abadd1aabaaa2353bccd4a48bc561e779) = new boost::thread(boost::bind(&[GazeboROSNode::PhysicsReconfigureNode](classGazeboROSNode.html#aeeeaf330e57c06557910d62034bab2d5), this));
    00316
    00318       this->[AdvertiseServices](classGazeboROSNode.html#a373bfa381a9d1631537af92ecfa11499 "advertise services")();
    00319
    00320       // connect helper function to signal for scheduling torque/forces, etc
    00321       gazebo::World::Instance()->ConnectWorldUpdateStartSignal(boost::bind(&[GazeboROSNode::wrenchBodySchedulerSlot](classGazeboROSNode.html#a39113e9e18f20d71c38aeeaecc17584b),this));
    00322       gazebo::World::Instance()->ConnectWorldUpdateStartSignal(boost::bind(&[GazeboROSNode::forceJointSchedulerSlot](classGazeboROSNode.html#aee5784a84181a115059d6cf43a0cb67d),this));
    00323       gazebo::World::Instance()->ConnectWorldUpdateStartSignal(boost::bind(&[GazeboROSNode::publishSimTime](classGazeboROSNode.html#a48733f4c02ab9c9976653dfd37c89e34),this));
    00324
    00325       // for internal gazebo xml use


Copy link


![Epsxe On-screen Gamepad skins \(For Android\)](//i.imgur.com/Oc5rtZR.jpg)


[ ](//www.rssing.com/index.php?zw=2123 "Home") [ $ ](javascript:; "MoMoney")


**[ musamarcusso ](/musamarcusso) ** commented  Aug 29, 2019


50 hidden items  Load more…


[ _≫_ Next: Gazebo sim code concepts
](//gazebo214.rssing.com/chan-57893035/latest.php#c57893035a6946 "Next
Article")


[ ![@hsu](https://avatars.githubusercontent.com/u/138109?s=40&v=4) ](/hsu)


    00858       {
    00859         [ROS_ERROR](../../../api/rosconsole/html/macros__generated_8h.html#a7fb635b03cc608284eadecd2f8becd9a)("DeleteModel: model [%s] does not exist",req.[model_name](../../gazebo_msgs/html/structgazebo__msgs_1_1DeleteModelRequest__.html#ae6bbe17db56816c9331ef6bf466e5f21).c_str());
    00860         res.[success](../../gazebo_msgs/html/structgazebo__msgs_1_1DeleteModelResponse__.html#a51152f41440f853bd60c199e254a7789) = false;
    00861         res.[status_message](../../gazebo_msgs/html/structgazebo__msgs_1_1DeleteModelResponse__.html#ad32bf4e34bc8e7d8cf5f5fcf85dc9754) = "DeleteModel: model does not exist";
    00862         return false;
    00863       }
    00864
    00865       // delete wrench jobs on bodies
    00866       const std::vector<gazebo::Entity*> children = model->GetChildren();
    00867       for (std::vector<gazebo::Entity*>::const_iterator iter=children.begin();iter!=children.end();iter++)
    00868       {
    00869         gazebo::Body* body = (gazebo::Body*)(*iter);
    00870         if (body)
    00871         {
    00872           // look for it in jobs, delete body wrench jobs
    00873           this->[clearBodyWrenches](classGazeboROSNode.html#a8434da6f0a95fe58cceaf5518c906a8b)(body->GetScopedName());
    00874         }
    00875       }
    00876       // delete force jobs on joints
    00877       for (unsigned int [i](../../../api/ivcon/html/ivcon_8c.html#acb559820d9ca11295b4500f179ef6392)=0;[i](../../../api/ivcon/html/ivcon_8c.html#acb559820d9ca11295b4500f179ef6392)< model->GetJointCount(); [i](../../../api/ivcon/html/ivcon_8c.html#acb559820d9ca11295b4500f179ef6392)++)
    00878       {
    00879         gazebo::Joint* joint = model->GetJoint([i](../../../api/ivcon/html/ivcon_8c.html#acb559820d9ca11295b4500f179ef6392));
    00880         // look for it in jobs, delete joint force jobs
    00881         this->[clearJointForces](classGazeboROSNode.html#a79ad3a609931f0e04b497126d5ae49d7)(joint->GetName());
    00882       }
    00883
    00884       // delete model
    00885       gazebo::World::Instance()->SetSelectedEntity(NULL);
    00886       gazebo::World::Instance()->DeleteEntity(req.[model_name](../../gazebo_msgs/html/structgazebo__msgs_1_1DeleteModelRequest__.html#ae6bbe17db56816c9331ef6bf466e5f21));
    00887
    00888       [ros::Duration](../../../api/rostime/html/classros_1_1Duration.html) model_spawn_timeout(60.0);
    00889       [ros::Time](../../../api/rostime/html/classros_1_1Time.html) timeout = [ros::Time::now](../../../api/rostime/html/classros_1_1Time.html#a4652034e29ceebf378d5930ff5914c0c)() + model_spawn_timeout;
    00890       // wait and verify that model is deleted
    00891       while (true)
    00892       {
    00893         if ([ros::Time::now](../../../api/rostime/html/classros_1_1Time.html#a4652034e29ceebf378d5930ff5914c0c)() > timeout)
    00894         {
    00895           res.[success](../../gazebo_msgs/html/structgazebo__msgs_1_1DeleteModelResponse__.html#a51152f41440f853bd60c199e254a7789) = false;
    00896           res.[status_message](../../gazebo_msgs/html/structgazebo__msgs_1_1DeleteModelResponse__.html#ad32bf4e34bc8e7d8cf5f5fcf85dc9754) = std::string("DeleteModel: Model pushed to delete queue, but delete service timed out waiting for model to disappear from simulation");
    00897           return false;


[
![@musamarcusso](https://avatars.githubusercontent.com/u/20180849?s=80&u=745333d0934f6e2a8167631b74be0d81f25fabad&v=4)
](/musamarcusso)


You can create custom ` .world ` files within your own ROS packages that are
specific to your robots and packages. In this mini tutorial we'll make an
empty world with a ground, a sun, and a gas station. The following is our
recommended convention. Be sure to replace MYROBOT with the name of your bot,
or if you don't have a robot to test with just replace it with something like
'test':


    00448           get_link_properties_service_name,boost::bind(&[GazeboROSNode::getLinkProperties](classGazeboROSNode.html#a0b81cc4d3c13b3b3e3feee801e4caa48),this,_1,_2),
    00449           ros::VoidPtr(), &this->[gazebo_queue_](classGazeboROSNode.html#aaad18c9d54a8736ea6337821de03889a));
    00450       [get_link_properties_service_](classGazeboROSNode.html#a813f1a04d708c60c34e9f8b864a771ed) = this->[rosnode_](classGazeboROSNode.html#ae9011736edb2ec542d7176cdddeb546d).[advertiseService](../../../api/roscpp/html/classros_1_1NodeHandle.html#ae659319707eb40e8ef302763f7d632da)(get_link_properties_aso);
    00451
    00452       // Advertise more services on the custom queue
    00453       std::string get_link_state_service_name("get_link_state");
    00454       [ros::AdvertiseServiceOptions](../../../api/roscpp/html/structros_1_1AdvertiseServiceOptions.html) get_link_state_aso = ros::AdvertiseServiceOptions::create<gazebo_msgs::GetLinkState>(
    00455           get_link_state_service_name,boost::bind(&[GazeboROSNode::getLinkState](classGazeboROSNode.html#af0eae1e0c329412d822c8c72e9f60b3e),this,_1,_2),
    00456           ros::VoidPtr(), &this->[gazebo_queue_](classGazeboROSNode.html#aaad18c9d54a8736ea6337821de03889a));
    00457       [get_link_state_service_](classGazeboROSNode.html#aecd05ef53d8ef891a0c675d1a5f28c09) = this->[rosnode_](classGazeboROSNode.html#ae9011736edb2ec542d7176cdddeb546d).[advertiseService](../../../api/roscpp/html/classros_1_1NodeHandle.html#ae659319707eb40e8ef302763f7d632da)(get_link_state_aso);
    00458
    00459       // Advertise more services on the custom queue
    00460       std::string set_link_properties_service_name("set_link_properties");
    00461       [ros::AdvertiseServiceOptions](../../../api/roscpp/html/structros_1_1AdvertiseServiceOptions.html) set_link_properties_aso = ros::AdvertiseServiceOptions::create<gazebo_msgs::SetLinkProperties>(
    00462           set_link_properties_service_name,boost::bind(&[GazeboROSNode::setLinkProperties](classGazeboROSNode.html#a760bdded5957218245e985ccc568b0fa),this,_1,_2),
    00463           ros::VoidPtr(), &this->[gazebo_queue_](classGazeboROSNode.html#aaad18c9d54a8736ea6337821de03889a));
    00464       [set_link_properties_service_](classGazeboROSNode.html#a901e93c427ccb3007269685d709a5d5e) = this->[rosnode_](classGazeboROSNode.html#ae9011736edb2ec542d7176cdddeb546d).[advertiseService](../../../api/roscpp/html/classros_1_1NodeHandle.html#ae659319707eb40e8ef302763f7d632da)(set_link_properties_aso);
    00465
    00466       // Advertise more services on the custom queue
    00467       std::string set_physics_properties_service_name("set_physics_properties");
    00468       [ros::AdvertiseServiceOptions](../../../api/roscpp/html/structros_1_1AdvertiseServiceOptions.html) set_physics_properties_aso = ros::AdvertiseServiceOptions::create<gazebo_msgs::SetPhysicsProperties>(
    00469           set_physics_properties_service_name,boost::bind(&[GazeboROSNode::setPhysicsProperties](classGazeboROSNode.html#a5cf06484d77fad60d8cb2effb985a83d),this,_1,_2),
    00470           ros::VoidPtr(), &this->[gazebo_queue_](classGazeboROSNode.html#aaad18c9d54a8736ea6337821de03889a));
    00471       [set_physics_properties_service_](classGazeboROSNode.html#af0b30926f98009ffd14147ad22b137ee) = this->[rosnode_](classGazeboROSNode.html#ae9011736edb2ec542d7176cdddeb546d).[advertiseService](../../../api/roscpp/html/classros_1_1NodeHandle.html#ae659319707eb40e8ef302763f7d632da)(set_physics_properties_aso);
    00472
    00473       // Advertise more services on the custom queue
    00474       std::string get_physics_properties_service_name("get_physics_properties");
    00475       [ros::AdvertiseServiceOptions](../../../api/roscpp/html/structros_1_1AdvertiseServiceOptions.html) get_physics_properties_aso = ros::AdvertiseServiceOptions::create<gazebo_msgs::GetPhysicsProperties>(
    00476           get_physics_properties_service_name,boost::bind(&[GazeboROSNode::getPhysicsProperties](classGazeboROSNode.html#a09bff824f10a47e8b958ac3a38967a78),this,_1,_2),
    00477           ros::VoidPtr(), &this->[gazebo_queue_](classGazeboROSNode.html#aaad18c9d54a8736ea6337821de03889a));
    00478       [get_physics_properties_service_](classGazeboROSNode.html#a6bb1fa9e176137ed05eed396e54f6c58) = this->[rosnode_](classGazeboROSNode.html#ae9011736edb2ec542d7176cdddeb546d).[advertiseService](../../../api/roscpp/html/classros_1_1NodeHandle.html#ae659319707eb40e8ef302763f7d632da)(get_physics_properties_aso);
    00479
    00480       // Advertise more services on the custom queue
    00481       std::string apply_body_wrench_service_name("apply_body_wrench");
    00482       [ros::AdvertiseServiceOptions](../../../api/roscpp/html/structros_1_1AdvertiseServiceOptions.html) apply_body_wrench_aso = ros::AdvertiseServiceOptions::create<gazebo_msgs::ApplyBodyWrench>(
    00483           apply_body_wrench_service_name,boost::bind(&[GazeboROSNode::applyBodyWrench](classGazeboROSNode.html#affc8ea4611f0cd8c4b4a497056359398),this,_1,_2),
    00484           ros::VoidPtr(), &this->[gazebo_queue_](classGazeboROSNode.html#aaad18c9d54a8736ea6337821de03889a));
    00485       [apply_body_wrench_service_](classGazeboROSNode.html#a00bff62a4053d3ce149659ec76ed33c0) = this->[rosnode_](classGazeboROSNode.html#ae9011736edb2ec542d7176cdddeb546d).[advertiseService](../../../api/roscpp/html/classros_1_1NodeHandle.html#ae659319707eb40e8ef302763f7d632da)(apply_body_wrench_aso);
    00486
    00487       // Advertise more services on the custom queue


    02454             link_states.[twist](../../gazebo_msgs/html/structgazebo__msgs_1_1LinkStates__.html#a2bffebd01b9e33fac565b6795389958f).push_back(twist);
    02455           }
    02456         }
    02457       }
    02458       this->[pub_link_states_](classGazeboROSNode.html#ac591a7b9378b025c5acd7b53a59e87b5).[publish](../../../api/roscpp/html/classros_1_1Publisher.html#af4e0009d55b5a7729fd71c3ffdf502cd)(link_states);
    02459     }
    02460
    [02463](classGazeboROSNode.html#a3dfb358eb77f12aa7f328aa0f6e712f0)     void [publishModelStates](classGazeboROSNode.html#a3dfb358eb77f12aa7f328aa0f6e712f0)()
    02464     {
    02465       [gazebo_msgs::ModelStates](../../gazebo_msgs/html/structgazebo__msgs_1_1ModelStates__.html) model_states;
    02466       // fill model_states
    02467       const std::vector<gazebo::Model*> models = gazebo::World::Instance()->GetModels();
    02468       for (std::vector<gazebo::Model*>::const_iterator miter = models.begin(); miter != models.end(); miter++)
    02469       {
    02470         model_states.[name](../../gazebo_msgs/html/structgazebo__msgs_1_1ModelStates__.html#a6774b62bfe88d04536b8a63167e01f93).push_back((*miter)->GetCompleteScopedName());
    02471         [geometry_msgs::Pose](../../../api/geometry_msgs/html/structgeometry__msgs_1_1Pose__.html) pose;
    02472         gazebo::Pose3d  model_pose = (*miter)->GetWorldPose(); // - this->myBody->GetCoMPose();
    02473         gazebo::Vector3 pos = model_pose.pos;
    02474         gazebo::Quatern rot = model_pose.rot;
    02475         pose.[position](../../../api/geometry_msgs/html/structgeometry__msgs_1_1Pose__.html#a27067d1772d85a856b0e4ed4690a80b4).[x](../../../api/geometry_msgs/html/structgeometry__msgs_1_1Point__.html#acd9420e6916084b2a9c09019bfda1708) = pos.x;
    02476         pose.[position](../../../api/geometry_msgs/html/structgeometry__msgs_1_1Pose__.html#a27067d1772d85a856b0e4ed4690a80b4).[y](../../../api/geometry_msgs/html/structgeometry__msgs_1_1Point__.html#a46a84ff5a3e5817ab5693abda66fccb0) = pos.y;
    02477         pose.[position](../../../api/geometry_msgs/html/structgeometry__msgs_1_1Pose__.html#a27067d1772d85a856b0e4ed4690a80b4).[z](../../../api/geometry_msgs/html/structgeometry__msgs_1_1Point__.html#a061f0093e927a95998f35ceceb5cebda) = pos.z;
    02478         pose.[orientation](../../../api/geometry_msgs/html/structgeometry__msgs_1_1Pose__.html#af8c1d34a44a7628ea9c3e571339f5a28).[w](../../../api/geometry_msgs/html/structgeometry__msgs_1_1Quaternion__.html#a440791d268a65607ecbac21e0ed153cf) = rot.u;
    02479         pose.[orientation](../../../api/geometry_msgs/html/structgeometry__msgs_1_1Pose__.html#af8c1d34a44a7628ea9c3e571339f5a28).[x](../../../api/geometry_msgs/html/structgeometry__msgs_1_1Quaternion__.html#a11f3b4e2df587ce516fd2a8140c1c7c5) = rot.x;
    02480         pose.[orientation](../../../api/geometry_msgs/html/structgeometry__msgs_1_1Pose__.html#af8c1d34a44a7628ea9c3e571339f5a28).[y](../../../api/geometry_msgs/html/structgeometry__msgs_1_1Quaternion__.html#a601c978178311ce3a618afb38c0b6b98) = rot.y;
    02481         pose.[orientation](../../../api/geometry_msgs/html/structgeometry__msgs_1_1Pose__.html#af8c1d34a44a7628ea9c3e571339f5a28).[z](../../../api/geometry_msgs/html/structgeometry__msgs_1_1Quaternion__.html#ae2caceb9fc4b2fd01acd8419aa7ebc2e) = rot.z;
    02482         model_states.[pose](../../gazebo_msgs/html/structgazebo__msgs_1_1ModelStates__.html#aeb2d8d6b18ca584c5fe37e72c0d0dccd).push_back(pose);
    02483         gazebo::Vector3 linear_vel  = (*miter)->GetWorldLinearVel();
    02484         gazebo::Vector3 angular_vel = (*miter)->GetWorldAngularVel();
    02485         [geometry_msgs::Twist](../../../api/geometry_msgs/html/structgeometry__msgs_1_1Twist__.html) twist;
    02486         twist.[linear](../../../api/geometry_msgs/html/structgeometry__msgs_1_1Twist__.html#a394500332ac20028528c37103e1bf8e5).[x](../../../api/geometry_msgs/html/structgeometry__msgs_1_1Vector3__.html#abf9dabaf651196aee50fd14bf3b643be) = linear_vel.x;
    02487         twist.[linear](../../../api/geometry_msgs/html/structgeometry__msgs_1_1Twist__.html#a394500332ac20028528c37103e1bf8e5).[y](../../../api/geometry_msgs/html/structgeometry__msgs_1_1Vector3__.html#aaea58ad929c43960a06f728d97132404) = linear_vel.y;
    02488         twist.[linear](../../../api/geometry_msgs/html/structgeometry__msgs_1_1Twist__.html#a394500332ac20028528c37103e1bf8e5).[z](../../../api/geometry_msgs/html/structgeometry__msgs_1_1Vector3__.html#a4cde719326e6c3688ab50b51ab4708b1) = linear_vel.z;
    02489         twist.[angular](../../../api/geometry_msgs/html/structgeometry__msgs_1_1Twist__.html#aa0cb518e509179290aa793228ef01f6b).[x](../../../api/geometry_msgs/html/structgeometry__msgs_1_1Vector3__.html#abf9dabaf651196aee50fd14bf3b643be) = angular_vel.x;
    02490         twist.[angular](../../../api/geometry_msgs/html/structgeometry__msgs_1_1Twist__.html#aa0cb518e509179290aa793228ef01f6b).[y](../../../api/geometry_msgs/html/structgeometry__msgs_1_1Vector3__.html#aaea58ad929c43960a06f728d97132404) = angular_vel.y;
    02491         twist.[angular](../../../api/geometry_msgs/html/structgeometry__msgs_1_1Twist__.html#aa0cb518e509179290aa793228ef01f6b).[z](../../../api/geometry_msgs/html/structgeometry__msgs_1_1Vector3__.html#a4cde719326e6c3688ab50b51ab4708b1) = angular_vel.z;
    02492         model_states.[twist](../../gazebo_msgs/html/structgazebo__msgs_1_1ModelStates__.html#a182ac64781c745e9f8f7bd40b825caa9).push_back(twist);
    02493       }
    02494       this->[pub_model_states_](classGazeboROSNode.html#a9956d9b0ba56fa9ae7910588c22931e0).[publish](../../../api/roscpp/html/classros_1_1Publisher.html#af4e0009d55b5a7729fd71c3ffdf502cd)(model_states);
    02495     }


![Top 20 Hot and Sexy Dragon Ball Z Girls
\(Characters\)](//1.bp.blogspot.com/-OqJPaiXp4As/U1r7dNW2ElI/AAAAAAAAk_I/J7YbqMD1OJk/s1600/pan-
of-dragon-ball-z.jpg)


[ _≪_ Previous: Failed to load gz-sim-diff-drive-system
](//gazebo214.rssing.com/chan-57893035/latest.php#c57893035a6943 "Previous
Article")


    01408       }
    01409     }
    01410
    [01413](classGazeboROSNode.html#a73523a3c37f0cc5d970d51cc78b38cfd)     void [updateModelState](classGazeboROSNode.html#a73523a3c37f0cc5d970d51cc78b38cfd)(const [gazebo_msgs::ModelState::ConstPtr](../../gazebo_msgs/html/structgazebo__msgs_1_1ModelState__.html#a0b49538ac4fc57ed9051f9de02cf2ee7)& model_state)
    01414     {
    01415       gazebo::Vector3 target_pos(model_state->pose.position.x,model_state->pose.position.y,model_state->pose.position.z);
    01416       gazebo::Quatern target_rot(model_state->pose.orientation.w,model_state->pose.orientation.x,model_state->pose.orientation.y,model_state->pose.orientation.z);
    01417       gazebo::Pose3d target_pose(target_pos,target_rot);
    01418       gazebo::Vector3 target_pos_dot(model_state->twist.linear.x,model_state->twist.linear.y,model_state->twist.linear.z);
    01419       gazebo::Vector3 target_rot_dot(model_state->twist.angular.x,model_state->twist.angular.y,model_state->twist.angular.z);
    01420
    01421       gazebo::Model* model = dynamic_cast<gazebo::Model*>(gazebo::World::Instance()->GetEntityByName(model_state->model_name));
    01422       if (!model)
    01423       {
    01424         [ROS_ERROR](../../../api/rosconsole/html/macros__generated_8h.html#a7fb635b03cc608284eadecd2f8becd9a)("updateModelState: model [%s] does not exist",model_state->model_name.c_str());
    01425         return;
    01426       }
    01427       else
    01428       {
    01429         gazebo::Entity* relative_entity = NULL;
    01430
    01431         relative_entity = gazebo::World::Instance()->GetEntityByName(model_state->reference_frame);
    01432         if (relative_entity)
    01433         {
    01434           gazebo::Pose3d  frame_pose = relative_entity->GetWorldPose(); // - this->myBody->GetCoMPose();
    01435           gazebo::Vector3 frame_pos = frame_pose.pos;
    01436           gazebo::Quatern frame_rot = frame_pose.rot;
    01437
    01438           //std::cout << " debug : " << relative_entity->GetName() << " : " << frame_pose << " : " << target_pose << std::endl;
    01439           //target_pose = frame_pose + target_pose; // seems buggy, use my own
    01440           target_pose.pos = frame_pos + frame_rot.RotateVector(target_pos);
    01441           target_pose.rot = frame_rot * target_pose.rot;
    01442         }
    01443         else if (model_state->reference_frame == "" || model_state->reference_frame == "world" || model_state->reference_frame == "map" || model_state->reference_frame == "/map" )
    01444         {
    01445           [ROS_DEBUG](../../../api/rosconsole/html/macros__generated_8h.html#a83228c0b42c80605abdd0f42af64b1f7)("updateModelState: using inertial reference frame");
    01446         }
    01447         else
    01448         {
    01449           [ROS_ERROR](../../../api/rosconsole/html/macros__generated_8h.html#a7fb635b03cc608284eadecd2f8becd9a)("updateModelState: for model[%s], specified relative frame [%s] does not exist",


[ ![@HareshKarnan](https://avatars.githubusercontent.com/u/5285984?s=40&v=4)
](/HareshKarnan) [ HareshKarnan ](/HareshKarnan) mentioned this issue  Feb 7,
2020


Showing 30 articles in the latest snapshot of channel 57893035
Channel Details:


Other demo worlds are already included in the ` gazebo_ros ` package,
including:


Dear all, I was looking into the conveyor demo and specifically [why it didn't
work](https://github.com/gazebosim/gz-
sim/issues/1662#issuecomment-1485840870). As it turns out it is due to a patch
not having been merged until `dart6.13`. Anyway, before I realized that I had
been looking extensively at the source code, and there's a certain mechanism
I'd like to understand better: Given a dart version


Collaborator  Author


**paused**


[ ![@k-okada](https://avatars.githubusercontent.com/u/493276?s=40&v=4)
](/k-okada)


More Pages to Explore .....


[ ↂ
](////heroturko111.rssing.com/chan-16832457/article82.html#c16832457a82i1004730930
"Noise Industries FxFactory Pro 3.0.2 \[MAC\]")


[ ![@hsu](https://avatars.githubusercontent.com/u/138109?s=80&v=4) ](/hsu)


Sorry, something went wrong.


#  [ Gazebo Fortress Custom plugins causing scene to not load
](//gazebo214.rssing.com/chan-57893035/latest-article10-live.php)


August 2, 2023, 3:57 pm


[ _≪_ Previous: How to get information between entities in contact with
disabled physical collisions?
](//gazebo214.rssing.com/chan-57893035/latest.php#c57893035a6950 "Previous
Article")


All reactions


    <node name="spawn_urdf" pkg="gazebo_ros" type="spawn_model"
        args="-param robot_description -urdf -unpause $(arg some_start_pose) -model the_robot -J the_robot::joint_1 -1 -J the_robot::joint_2 -2 -J the_robot::joint_3 0.75 " />

---

👍  1  srediske reacted with thumbs up emoji


    00608         gazebo::World::Instance()->ConnectWorldUpdateStartSignal(boost::bind(&[GazeboROSNode::publishLinkStates](classGazeboROSNode.html#abdcedd88754decfd73b04c1e9d7f5023),this));
    00609     }
    [00610](classGazeboROSNode.html#a55b6baafd9670e2d80866b97fe4a0623)     void [onModelStatesConnect](classGazeboROSNode.html#a55b6baafd9670e2d80866b97fe4a0623)()
    00611     {
    00612       this->[pub_model_states_connection_count_](classGazeboROSNode.html#a5c5117f163d5a790ffd92cb56073ca66)++;
    00613       if (this->[pub_model_states_connection_count_](classGazeboROSNode.html#a5c5117f163d5a790ffd92cb56073ca66) == 1) // connect on first subscriber
    00614         gazebo::World::Instance()->ConnectWorldUpdateStartSignal(boost::bind(&[GazeboROSNode::publishModelStates](classGazeboROSNode.html#a3dfb358eb77f12aa7f328aa0f6e712f0),this));
    00615     }
    [00616](classGazeboROSNode.html#a6574b2aebfd496f2884e34c45fa27926)     void [onLinkStatesDisconnect](classGazeboROSNode.html#a6574b2aebfd496f2884e34c45fa27926)()
    00617     {
    00618       this->[pub_link_states_connection_count_](classGazeboROSNode.html#ac131709cfe171cca7a556620a9180d56)--;
    00619       if (this->[pub_link_states_connection_count_](classGazeboROSNode.html#ac131709cfe171cca7a556620a9180d56) == 0) // disconnect with no subscribers
    00620         gazebo::World::Instance()->DisconnectWorldUpdateStartSignal(boost::bind(&[GazeboROSNode::publishLinkStates](classGazeboROSNode.html#abdcedd88754decfd73b04c1e9d7f5023),this));
    00621       else if (this->[pub_link_states_connection_count_](classGazeboROSNode.html#ac131709cfe171cca7a556620a9180d56) < 0) // should not be possible
    00622         [ROS_ERROR](../../../api/rosconsole/html/macros__generated_8h.html#a7fb635b03cc608284eadecd2f8becd9a)("one too mandy disconnect from pub_link_states_ in gazeboros.cpp? something weird");
    00623     }
    [00624](classGazeboROSNode.html#a15ae648d7bede494570b980d7135226b)     void [onModelStatesDisconnect](classGazeboROSNode.html#a15ae648d7bede494570b980d7135226b)()
    00625     {
    00626       this->[pub_model_states_connection_count_](classGazeboROSNode.html#a5c5117f163d5a790ffd92cb56073ca66)--;
    00627       if (this->[pub_model_states_connection_count_](classGazeboROSNode.html#a5c5117f163d5a790ffd92cb56073ca66) == 0) // disconnect with no subscribers
    00628         gazebo::World::Instance()->DisconnectWorldUpdateStartSignal(boost::bind(&[GazeboROSNode::publishModelStates](classGazeboROSNode.html#a3dfb358eb77f12aa7f328aa0f6e712f0),this));
    00629       else if (this->[pub_model_states_connection_count_](classGazeboROSNode.html#a5c5117f163d5a790ffd92cb56073ca66) < 0) // should not be possible
    00630         [ROS_ERROR](../../../api/rosconsole/html/macros__generated_8h.html#a7fb635b03cc608284eadecd2f8becd9a)("one too mandy disconnect from pub_model_states_ in gazeboros.cpp? something weird");
    00631     }
    00632
    [00633](classGazeboROSNode.html#ae64f3ffa32532763364a4b1c0fa0578e)     bool [spawnURDFModel](classGazeboROSNode.html#ae64f3ffa32532763364a4b1c0fa0578e)([gazebo_msgs::SpawnModel::Request](../../gazebo_msgs/html/structgazebo__msgs_1_1SpawnModelRequest__.html) &req,[gazebo_msgs::SpawnModel::Response](../../gazebo_msgs/html/structgazebo__msgs_1_1SpawnModelResponse__.html) &res)
    00634     {
    00635       // get flag on joint limits
    00636       bool enforce_limits = true; //option to add req.enforce_limits??
    00637
    00638       // get name space for the corresponding model plugins
    00639       std::string robot_namespace = req.[robot_namespace](../../gazebo_msgs/html/structgazebo__msgs_1_1SpawnModelRequest__.html#a3c578c1623a220e86e6ef67489356b12);
    00640
    00641       // incoming robot name
    00642       std::string model_name = req.[model_name](../../gazebo_msgs/html/structgazebo__msgs_1_1SpawnModelRequest__.html#a3f46d36811a6f381a676b7ac60691259);
    00643
    00644       // incoming robot model string
    00645       std::string model_xml = req.[model_xml](../../gazebo_msgs/html/structgazebo__msgs_1_1SpawnModelRequest__.html#a4ea852fe421bee28bcaa852e69e13004);
    00646
    00647       if (!this->[IsURDF](classGazeboROSNode.html#a44e27d338cc6fef752fcc039a6daa3ec "utilites for checking incoming string URDF/XML/Param")(model_xml) && ![IsColladaData](classGazeboROSNode.html#a476d9e8af3d9ad6b6a9385fe94455ced)(model_xml))


RSSing.com


[ ](javascript:; "Share Article") [
](//www.rssing.com/contact.php?r=o6&u=%2F%2Fgazebo214.rssing.com%2Fchan-57893035%2Flatest-
article7-live.php "Article Support")


###  Editing the World File Within Gazebo


I am simulating a [franka panda arm](https://frankaemika.github.io/docs/)
mounted with [shadowhand](https://shadow-robot-company-dexterous-
hand.readthedocs-hosted.com/en/latest/index.html) in Gazebo. However, exsiting
controllers of panda and shadowhand require different groups of hardware
interfaces (or HWSim in Gazebo language). Currently I try to add the
FrankaHWSim in
[franka_gazebo](https://github.com/frankaemika/franka_ros/tree/develop/franka_gazebo)
package and the SrGazeboHWSim in [sr_gazebo_sim](https://github.com/shadow-
robot/sr_core/tree/noetic-devel/sr_gazebo_sim) package at the same time. My
approach is through adding two  labels as follows:
/mountedhand_only_description  sr_gazebo_sim/SrGazeboHWSim  0.001
/panda_only_description  franka_gazebo/FrankaHWSim  As above,
libgazebo_ros_control.so is loaded twice with different robot_description from
the parameter server. However, the custom hardware interfaces in
franka_gazebo/FrankaHWSim is never loaded. I find that the order of plugins
matters. That is to say, the hardware interfaces in the first  tag could
always be loaded successfully. What's wrong with my implementation? Should I
integrate the source codes of sr_gazebo_sim/SrGazeboHWSim and
franka_gazebo/FrankaHWSim together to get a combined HWSim. Thanks very much!


![Class 10 Sanskrit Grammar Book Solutions
अपठित-अवबोधनम्](//www.learncbse.in/wp-content/uploads/2017/08/NCERT-Solutions-
for-Class-10th-Sanskrit-Chapter-1-अपठित-अवबोधनम-2.jpg)


Copy link


[ ](javascript:; "Share Article") [
](//www.rssing.com/contact.php?r=o6&u=%2F%2Fgazebo214.rssing.com%2Fchan-57893035%2Flatest-
article30-live.php "Article Support")


* 👍  1 reaction


export GAZEBO_MODEL_PATH=/home/user/catkin_ws/src/


    <launch>
      <!-- We resume the logic in empty_world.launch, changing only the name of the world to be launched -->
      <include file="$(find gazebo_ros)/launch/empty_world.launch">
        <arg name="world_name" value="worlds/mud.world"/> <!-- Note: the world_name is with respect to GAZEBO_RESOURCE_PATH environmental variable -->
        <arg name="paused" value="false"/>
        <arg name="use_sim_time" value="true"/>
        <arg name="gui" value="true"/>
        <arg name="recording" value="false"/>
        <arg name="debug" value="false"/>
      </include>
    </launch>


Now that you know how to create ` roslaunch ` files that open Gazebo, world
files and URDF models, you are now ready to create your own Gazebo-ready URDF
model in the tutorial [ Using A URDF In Gazebo ](/tutorials/?tut=ros_urdf)


[ _≫_ Next: Explain 'Exporting model paths from a package.xml section' of
'Using roslaunch to start Gazebo' tutorial on Gazebo-Classic
](//gazebo214.rssing.com/chan-57893035/latest.php#c57893035a6952 "Next
Article")


**gui**


Then (replace the file location of the URDF):


Also come across this bug when trying to state an initial position of a dual-
arm robot with -J tags. Works correctly when setting pause to true, and then
starting the simulation using the start button in the Gazebo GUI as [ @mintar
](https://github.com/mintar) suggests. Thank you!

---

All reactions


[ ](javascript:; "Ouch") 0


    [01626](classGazeboROSNode.html#a131c45793b70f3fa421701a96ddaa84b)     void [setModelJointPositions](classGazeboROSNode.html#a131c45793b70f3fa421701a96ddaa84b)(gazebo::Model* gazebo_model,std::vector<std::string> joint_names, std::vector<double> joint_positions)
    01627     {
    01628
    01629       // go through all joints in this model and update each one
    01630       //   for each joint update, recursively update all children
    01631       int joint_count = gazebo_model->GetJointCount();
    01632       for (int [i](../../../api/ivcon/html/ivcon_8c.html#acb559820d9ca11295b4500f179ef6392) = 0; [i](../../../api/ivcon/html/ivcon_8c.html#acb559820d9ca11295b4500f179ef6392) < joint_count ; [i](../../../api/ivcon/html/ivcon_8c.html#acb559820d9ca11295b4500f179ef6392)++)
    01633       {
    01634         gazebo::Joint* joint = gazebo_model->GetJoint([i](../../../api/ivcon/html/ivcon_8c.html#acb559820d9ca11295b4500f179ef6392));
    01635
    01636         double target_position;
    01637         // only deal with hinge and revolute joints in the user request joint_names list
    01638         gazebo::Joint::Type [type](../../../api/test_roscpp/html/publisher__for__star__subscriber_8cpp.html#a6def72cbab7e986d0ac5dc7291e1394a) = joint->GetType();
    01639         if ((type == gazebo::Joint::HINGE || type == gazebo::Joint::SLIDER)
    01640             && [findJointPosition](classGazeboROSNode.html#a8baef56eaa181b6f78eb88dbefe9fa5a)(target_position,joint->GetName(),joint_names,joint_positions))
    01641         {
    01642           gazebo::Vector3 anchor = joint->GetAnchor(0); // worldPose.pos of anchor point
    01643           gazebo::Vector3 axis = joint->GetAxis(0);     // joint axis in world frame
    01644           double current_position = joint->GetAngle(0).GetAsRadian(); // joint position
    01645           //std::cout << "    name[" << joint->GetName() << "] axis[" << axis << "] target [" << target_position << "]\n";
    01646
    01647           gazebo::Body* body0 = [getParentBody](classGazeboROSNode.html#a6cdfd1e109477950bf6e002efaf1f96d)(joint);
    01648           gazebo::Body* body1 = [getChildBody](classGazeboROSNode.html#a9d9585eb5e1a40f4d26683e5ba110267)(joint);
    01649
    01650           if (body0 && body1 && body0->GetName() != body1->GetName())
    01651           {
    01652
    01653             // transform about the current anchor, about the axis
    01654             switch(type)
    01655             {
    01656               case gazebo::Joint::HINGE: {
    01657                 // rotate child (body1) about anchor point, by delta-angle along axis
    01658                 double dangle = target_position - current_position;
    01659                 [rotateBodyAndChildren](classGazeboROSNode.html#ad672f69bc97ccbd478c0406402ccd3e8)(body1, anchor, axis, dangle);
    01660
    01661                 break;
    01662               }
    01663               case gazebo::Joint::SLIDER: {
    01664                 double dposition = target_position - current_position;
    01665                 [slideBodyAndChildren](classGazeboROSNode.html#a5489b398b9b99702d5d682ca523e2062)(body1, anchor, axis, dposition);


If your URDF is not in XML format but rather in [ XACRO
](http://ros.org/wiki/xacro) format, you can make a similar modification to
your launch file. You can run this PR2 example by installing this package:


[ spawn_model: seeding position of robot via roslaunch is not working
correctly  #102  ](/ros-simulation/gazebo_ros_pkgs/issues/102)


Hi, my question is similar to
[this](https://answers.gazebosim.org/question/28756/why-install-rolling-
sources-for-rosdep-when-using-humble-for-ros_gz/). The difference is I am
building Gazebo Garden from source, which I managed to do. As in the other
post, I encountered: ERROR: the following packages/stacks could not have their
rosdep keys resolved to system dependencies: ros_gz_image: Cannot locate
rosdep definition for [gz-transport12] ros_gz_sim: Cannot locate rosdep
definition for [gz-math7] ros_gz_bridge: Cannot locate rosdep definition for
[gz-transport12] Continuing to install resolvable dependencies... I understand
`gz-transport12` and `gz-math7` are not available in `packages.ros.org`, but I
built and installed them locally (there are `libgz-transport12.so` and `libgz-
math7.so` as well as other files in `/usr/local/bin`). How do I solve the
above error? I tried to change the order of installation (Gazebo first before
ros_gz, ros_gz first, etc) and also used `ROS_PACKAGE_PATH`, but I still see
the above error. (Or perhaps I did it wrongly.)


    01666
    01667                 break;
    01668               }
    01669               default: {
    01670                 [ROS_WARN](../../../api/rosconsole/html/macros__generated_8h.html#abcf5fc1b8d85f44e883971abef7689a5)("Setting non HINGE/SLIDER joint types not implemented [%s]",joint->GetName().c_str());
    01671                 break;
    01672               }
    01673             }
    01674
    01675           }
    01676
    01677         }
    01678       }
    01679     }
    01680
    [01681](classGazeboROSNode.html#a9d9585eb5e1a40f4d26683e5ba110267)     gazebo::Body* [getChildBody](classGazeboROSNode.html#a9d9585eb5e1a40f4d26683e5ba110267)(gazebo::Joint* joint)
    01682     {
    01683       // anchor is with the child (same as urdf)
    01684       if (joint->GetJointBody(0) == joint->anchorBody)
    01685         return joint->GetJointBody(0);
    01686       else if (joint->GetJointBody(1) == joint->anchorBody)
    01687         return joint->GetJointBody(1);
    01688       else
    01689         return NULL;
    01690     }
    01691
    [01692](classGazeboROSNode.html#a6cdfd1e109477950bf6e002efaf1f96d)     gazebo::Body* [getParentBody](classGazeboROSNode.html#a6cdfd1e109477950bf6e002efaf1f96d)(gazebo::Joint* joint)
    01693     {
    01694       if (joint->GetJointBody(0) == joint->anchorBody)
    01695         return joint->GetJointBody(1);
    01696       else if (joint->GetJointBody(1) == joint->anchorBody)
    01697         return joint->GetJointBody(0);
    01698       else
    01699         return NULL;
    01700     }
    01701
    [01702](classGazeboROSNode.html#ad672f69bc97ccbd478c0406402ccd3e8)     void [rotateBodyAndChildren](classGazeboROSNode.html#ad672f69bc97ccbd478c0406402ccd3e8)(gazebo::Body* body1, gazebo::Vector3 anchor, gazebo::Vector3 axis, double dangle, bool update_children = true)
    01703     {
    01704       gazebo::Pose3d world_pose = body1->GetWorldPose();
    01705       gazebo::Pose3d relative_pose(world_pose.pos - anchor,world_pose.rot); // relative to anchor point


Then I tried to use the ` -J ` arguments with the universal robot UR5 ( [
https://github.com/ipa-fxm/universal_robot/tree/test_initial_joint_position
](https://github.com/ipa-fxm/universal_robot/tree/test_initial_joint_position)
\- this branch is up-to-date with the official indigo-devel branch + ` -J `
arguments in the ur_gazebo ur5.launch file).
However, when starting ` roslaunch ur_gazebo ur5.launch ` the ` -J ` arguments
are not applied and the UR5 is still in the "all joints 0.0" configuration.
When I saw that the test files from `
gazebo_ros_pkgs/issue_93_set_joint_position ` branch were not using any
transmission, had no gazebo_ros_control plugin loaded and no ros_controller
started, I removed all that for the UR5 as well - without success. Even
starting gazebo in paused mode did not work.
In the end, I "accidentially" ran ` rosrun gazebo_ros spawn_model -urdf -param
robot_description -model ur5 -z 0.1 -J shoulder_pan_joint 0.0 -J
shoulder_lift_joint 0.0 -J elbow_joint -0.4 -J wrist_1_joint 0.0 -J
wrist_2_joint 0.5 -J wrist_3_joint 0.0 ` in a separate terminal, although the
model was already loaded in gazebo via the launch file - and this "respawned"
the model with the ` -J ` arguments applied!
Please note, that the arguments in the ` rosrun ` command are the same as
given in the launch file!


[ How to manually set link states  gazebosim/gz-sim#53  ](/gazebosim/gz-
sim/issues/53)


Sorry, something went wrong.


####  Table of Contents


**[ jacknlliu ](/jacknlliu) ** commented  Aug 6, 2018  •


[ ](//www.rssing.com/index.php?zw=2123 "Home") [ $ ](javascript:; "MoMoney")


#  [ Mesh optimization for "fast" simulation
](//gazebo214.rssing.com/chan-57893035/latest-article23-live.php)


using the command line argument -J


[ k-okada ](/k-okada) pushed a commit to k-okada/gazebo_ros_pkgs that
referenced this issue  Nov 27, 2014


Was there ever any resolution to this problem?


    01746       // recurse through children bodies
    01747       std::vector<gazebo::Body*> bodies;
    01748       if (update_children) [getAllChildrenBodies](classGazeboROSNode.html#af403122a7a4f56cc1711e2644048caa8)(bodies, body1->GetModel(), body1);
    01749       for (std::vector<gazebo::Body*>::iterator bit = bodies.begin(); bit != bodies.end(); bit++)
    01750         [slideBodyAndChildren](classGazeboROSNode.html#a5489b398b9b99702d5d682ca523e2062)((*bit), anchor, axis, dposition,false);
    01751
    01752     }
    01753
    [01754](classGazeboROSNode.html#af403122a7a4f56cc1711e2644048caa8)     void [getAllChildrenBodies](classGazeboROSNode.html#af403122a7a4f56cc1711e2644048caa8)(std::vector<gazebo::Body*> &bodies, gazebo::Model* model, gazebo::Body* body)
    01755     {
    01756       // strategy, for each child, recursively look for children
    01757       //           for each child, also look for parents to catch multiple roots
    01758       if (model)
    01759       {
    01760         int joint_count = model->GetJointCount();
    01761         for (int [i](../../../api/ivcon/html/ivcon_8c.html#acb559820d9ca11295b4500f179ef6392) = 0; [i](../../../api/ivcon/html/ivcon_8c.html#acb559820d9ca11295b4500f179ef6392) < joint_count ; [i](../../../api/ivcon/html/ivcon_8c.html#acb559820d9ca11295b4500f179ef6392)++)
    01762         {
    01763           gazebo::Joint* joint = model->GetJoint([i](../../../api/ivcon/html/ivcon_8c.html#acb559820d9ca11295b4500f179ef6392));
    01764           // recurse through children connected by joints
    01765           gazebo::Body* body0 = [getParentBody](classGazeboROSNode.html#a6cdfd1e109477950bf6e002efaf1f96d)(joint);
    01766           gazebo::Body* body1 = [getChildBody](classGazeboROSNode.html#a9d9585eb5e1a40f4d26683e5ba110267)(joint);
    01767           if (body0 && body1
    01768               && body0->GetName() != body1->GetName()
    01769               && body0->GetName() == body->GetName()
    01770               && ![inBodies](classGazeboROSNode.html#ae92990dde0739ce2c0dba88b653ab4d2)(body1,bodies))
    01771           {
    01772             bodies.push_back(body1);
    01773             [getAllChildrenBodies](classGazeboROSNode.html#af403122a7a4f56cc1711e2644048caa8)(bodies, body1->GetModel(), body1);
    01774             [getAllParentBodies](classGazeboROSNode.html#a267d19e1c7024d3711a3cced5fbc4ce7)(bodies, body1->GetModel(), body1, body);
    01775           }
    01776         }
    01777       }
    01778     }
    [01779](classGazeboROSNode.html#a267d19e1c7024d3711a3cced5fbc4ce7)     void [getAllParentBodies](classGazeboROSNode.html#a267d19e1c7024d3711a3cced5fbc4ce7)(std::vector<gazebo::Body*> &bodies, gazebo::Model* model, gazebo::Body* body, gazebo::Body* orig_parent_body)
    01780     {
    01781       if (model)
    01782       {
    01783         int joint_count = model->GetJointCount();
    01784         for (int [i](../../../api/ivcon/html/ivcon_8c.html#acb559820d9ca11295b4500f179ef6392) = 0; [i](../../../api/ivcon/html/ivcon_8c.html#acb559820d9ca11295b4500f179ef6392) < joint_count ; [i](../../../api/ivcon/html/ivcon_8c.html#acb559820d9ca11295b4500f179ef6392)++)
    01785         {


**[ davetcoleman ](/davetcoleman) ** commented  Sep 24, 2013


[ ](javascript:; "Share Article") [
](//www.rssing.com/contact.php?r=o6&u=%2F%2Fgazebo214.rssing.com%2Fchan-57893035%2Flatest-
article16-live.php "Article Support")


Collaborator


[ ![@hsu](https://avatars.githubusercontent.com/u/138109?s=52&v=4) ](/hsu) [
![@mintar](https://avatars.githubusercontent.com/u/320188?s=52&v=4) ](/mintar)
[ ![@corot](https://avatars.githubusercontent.com/u/322610?s=52&v=4) ](/corot)
[ ![@k-okada](https://avatars.githubusercontent.com/u/493276?s=52&v=4)
](/k-okada) [
![@fmessmer](https://avatars.githubusercontent.com/u/508006?s=52&v=4)
](/fmessmer) [
![@davetcoleman](https://avatars.githubusercontent.com/u/561060?s=52&v=4)
](/davetcoleman) [
![@mrjogo](https://avatars.githubusercontent.com/u/679360?s=52&v=4) ](/mrjogo)
[ ![@jbohren](https://avatars.githubusercontent.com/u/1253450?s=52&v=4)
](/jbohren) [
![@Nurgak](https://avatars.githubusercontent.com/u/1785126?s=52&v=4)
](/Nurgak) [
![@TheDash](https://avatars.githubusercontent.com/u/1786601?s=52&v=4)
](/TheDash) [
![@j-rivero](https://avatars.githubusercontent.com/u/2098802?s=52&v=4)
](/j-rivero) [
![@dpsolomon](https://avatars.githubusercontent.com/u/4515469?s=52&v=4)
](/dpsolomon) [
![@felixvd](https://avatars.githubusercontent.com/u/4535737?s=52&v=4)
](/felixvd) [ ![@the-raspberry-pi-
guy](https://avatars.githubusercontent.com/u/5570173?s=52&v=4) ](/the-
raspberry-pi-guy) [
![@jacknlliu](https://avatars.githubusercontent.com/u/6220143?s=52&v=4)
](/jacknlliu) [
![@anshulpaigwar](https://avatars.githubusercontent.com/u/6399885?s=52&v=4)
](/anshulpaigwar) [
![@Kukanani](https://avatars.githubusercontent.com/u/6893343?s=52&v=4)
](/Kukanani) [
![@rcywongaa](https://avatars.githubusercontent.com/u/7285669?s=52&v=4)
](/rcywongaa) [
![@rkeatin3](https://avatars.githubusercontent.com/u/9117204?s=52&v=4)
](/rkeatin3) [ ![@kev-the-
dev](https://avatars.githubusercontent.com/u/9502636?s=52&v=4) ](/kev-the-dev)
and others


July 30, 2023, 11:50 am


Copy link


` [ temporary hack to **fix** the -J joint position option (issue
](/k-okada/gazebo_ros_pkgs/commit/2e3841eb274c3fd8ca4fdb243490625a74677d20
"temporary hack to **fix** the -J joint position option \(issue #93\),
sleeping for 1 second to avoid race condition. this branch should only be used
for debugging, merge only as a last resort.") [ ros-sim…
](https://github.com/ros-simulation/gazebo_ros_pkgs/issues/93) ` …


###  [ Pumas 2022/2023 Font (TTF & OTF)
](////fonts1404.rssing.com/chan-57741102/article185.html#c57741102a185i1833605640)


Finally, you need to add an environment variable to your .bashrc file that
tells Gazebo where to look for model databases. Using the editor of your
choice edit "~/.bashrc". Check if you already have a ` GAZEBO_MODEL_PATH `
defined. If you already have one, append to it using a semi-colon, otherwise
add the new export. Assuming your Catkin workspace is in ` ~/catkin_ws/ ` Your
path should look something like:


[ ](javascript:; "Ouch") 0


[ ![@jbohren](https://avatars.githubusercontent.com/u/1253450?s=80&v=4)
](/jbohren)


      <node name="spawn_gazebo_model" pkg="gazebo_ros" type="spawn_model" args="-urdf -param robot_description -model robot
                  -z 0.0
                  -J elbow_joint 1.001
                  -unpause
                  " respawn="false" output="screen" />


> Run gzserver and gzclient with --verbose, printing errors and warnings to
> the terminal (default false)


In this world file snippet you can see that three models are referenced. The
three models are searched for within your local Gazebo Model Database. If not
found there, they are automatically pulled from Gazebo's online database.


[ ](javascript:; "Share Article") [
](//www.rssing.com/contact.php?r=o6&u=%2F%2Fgazebo214.rssing.com%2Fchan-57893035%2Flatest-
article9-live.php "Article Support")


**verbose**


git clone https://github.com/RethinkRobotics/baxter_common.git


[ ↂ
](////talos181.rssing.com/chan-58296078/article541.html#c58296078a541i381855922
"JasperLoader Emerges, Targets Italy with Gootkit Banking Trojan")


#  [ How to simulate a "Vaccum" or a suction action?
](//gazebo214.rssing.com/chan-57893035/latest-article16-live.php)


###  [ Stay Salty POTS Awareness Stretchy Stacking Bracelets | Set of
Three|...
](////pomaces4.rssing.com/chan-3795444/article11960.html#c3795444a11960i1086411135)


[ ](javascript:; "Share Article") [
](//www.rssing.com/contact.php?r=o6&u=%2F%2Fgazebo214.rssing.com%2Fchan-57893035%2Flatest-
article25-live.php "Article Support")


{{ message }}


    02537   // optional: setting environment variables according to ROS
    02538   //           e.g. setenv("OGRE_RESOURCE_PATH",ogre_package_path.c_str(),1);
    02539   // set ogre library paths by searching for package named ogre
    02540   gazebo::Simulator::Instance()->GetGazeboConfig()->ClearOgrePaths();
    02541   std::string ogre_package_name("ogre"); // @todo: un hardcode this???
    02542   std::string ogre_package_path = [ros::package::getPath](../../../api/roslib/html/namespaceros_1_1package.html#ae9470dd201aa4e66abb833e710d812a4)(ogre_package_name)+std::string("/ogre/lib/OGRE");
    02543   if (ogre_package_path.empty())
    02544     [ROS_DEBUG](../../../api/rosconsole/html/macros__generated_8h.html#a83228c0b42c80605abdd0f42af64b1f7)("Package[%s] does not exist, assuming user must have set OGRE_RESOURCE_PATH already.",ogre_package_name.c_str());
    02545   else
    02546   {
    02547     [ROS_DEBUG](../../../api/rosconsole/html/macros__generated_8h.html#a83228c0b42c80605abdd0f42af64b1f7)("ogre path %s",ogre_package_path.c_str());
    02548     gazebo::Simulator::Instance()->GetGazeboConfig()->AddOgrePaths(ogre_package_path);
    02549   }
    02550
    02551   // set gazebo media paths by adding all packages that exports "gazebo_media_path" for gazebo
    02552   gazebo::Simulator::Instance()->GetGazeboConfig()->ClearGazeboPaths();
    02553   std::vector<std::string> gazebo_media_paths;
    02554   [ros::package::getPlugins](../../../api/roslib/html/namespaceros_1_1package.html#ae2193b1a4a44af23d68a4fe85b469792)("gazebo","gazebo_media_path",gazebo_media_paths);
    02555   for (std::vector<std::string>::iterator iter=gazebo_media_paths.begin(); iter != gazebo_media_paths.end(); iter++)
    02556   {
    02557     [ROS_DEBUG](../../../api/rosconsole/html/macros__generated_8h.html#a83228c0b42c80605abdd0f42af64b1f7)("med path %s",iter->c_str());
    02558     gazebo::Simulator::Instance()->GetGazeboConfig()->AddGazeboPaths(iter->c_str());
    02559   }
    02560
    02561   // set gazebo plugins paths by adding all packages that exports "plugin" for gazebo
    02562   gazebo::Simulator::Instance()->GetGazeboConfig()->ClearPluginPaths();
    02563   std::vector<std::string> plugin_paths;
    02564   [ros::package::getPlugins](../../../api/roslib/html/namespaceros_1_1package.html#ae2193b1a4a44af23d68a4fe85b469792)("gazebo","plugin_path",plugin_paths);
    02565   for (std::vector<std::string>::iterator iter=plugin_paths.begin(); iter != plugin_paths.end(); iter++)
    02566   {
    02567     [ROS_DEBUG](../../../api/rosconsole/html/macros__generated_8h.html#a83228c0b42c80605abdd0f42af64b1f7)("plugin path %s",(*iter).c_str());
    02568     gazebo::Simulator::Instance()->GetGazeboConfig()->AddPluginPaths(iter->c_str());
    02569   }
    02570
    02571   // set .gazeborc path to something else, so we don't pick up default ~/.gazeborc
    02572   std::string gazeborc = [ros::package::getPath](../../../api/roslib/html/namespaceros_1_1package.html#ae9470dd201aa4e66abb833e710d812a4)("gazebo")+"/.do_not_use_gazeborc";
    02573   setenv("GAZEBORC",gazeborc.c_str(),1);
    02574
    02575   //Load the simulator
    02576   try


  <<                                  "terminal.\n"
  << "  -h [ --help ]                 Produce this help message.\n"
  << "  -u [ --pause ]                Start the server in a paused state.\n"
  << "  -e [ --physics ] arg          Specify a physics engine "
  << "(ode|bullet|dart|simbody).\n"
  << "  -p [ --play ] arg             Play a log file.\n"
  << "  -r [ --record ]               Record state data.\n"
  << "  --record_encoding arg (=zlib) Compression encoding format for log "
  << "data \n"
  << "                                (zlib|bz2|txt).\n"
  << "  --record_path arg             Absolute path in which to store "
  << "state data.\n"
  << "  --record_period arg (=-1)     Recording period (seconds).\n"
  << "  --record_filter arg           Recording filter (supports wildcard and "
  << "regular expression).\n"
  << "  --record_resources           Recording with model meshes and "
  << "materials.\n"
  << "  --seed arg                    Start with a given random number seed.\n"
  << "  --iters arg                   Number of iterations to simulate.\n"
  << "  --minimal_comms               Reduce the TCP/IP traffic output by "
  <<                                  "gazebo.\n"
  << "  -g [ --gui-plugin ] arg       Load a System plugin (deprecated)\n"
  << "  --gui-client-plugin arg       Load a GUI plugin.\n"
  << "  -s [ --server-plugin ] arg    Load a server plugin.\n"
  << "  -o [ --profile ] arg          Physics preset profile name from the "
  << "options in\n"
  << "                                the world file.\n"
  << "  --lockstep                    Lockstep simulation so sensor update "
  <<                                  "rates are respected.\n"
  << "\n";
}
#ifndef _WIN32
bool sig_killed = false;
int status1, status2;
// pid of server process
pid_t pid1;
// pid of client process
pid_t pid2;
bool killed1 = false;
bool killed2 = false;


For the rest of the tutorial, your MYROBOT_gazebo empty world needs to be
running.


Skip to content


Hello, I believe there is a bug in the tricycle plugin. I'm testing the ROS2
Galactic version of the plugin: https://github.com/ros-
simulation/gazebo_ros_pkgs/blob/galactic/gazebo_plugins/src/gazebo_ros_tricycle_drive.cpp
which I believe is quite similar to the ROS1 version. For this test, I'm using
the demo of the Tricycle plugin: https://github.com/ros-
simulation/gazebo_ros_pkgs/blob/galactic/gazebo_plugins/worlds/gazebo_ros_tricycle_drive_demo.world
I recorded a video of the behavior which you can see in the following Youtube
video: https://youtu.be/cjPqbctgsDY As you can see in the video, it is
impossible to control a tricycle robot in linear speed and angular position at
the same time. Any ideas of why is this happening? Best,


[ ](javascript:; "Like") 0


    02200           srv.[request](../../gazebo_msgs/html/structgazebo__msgs_1_1SetPhysicsProperties.html#a22bea3bf369b87d15113cb3d76cf3ae3).ode_config.contact_surface_layer      = config.contact_surface_layer       ;
    02201           srv.[request](../../gazebo_msgs/html/structgazebo__msgs_1_1SetPhysicsProperties.html#a22bea3bf369b87d15113cb3d76cf3ae3).ode_config.contact_max_correcting_vel = config.contact_max_correcting_vel  ;
    02202           srv.[request](../../gazebo_msgs/html/structgazebo__msgs_1_1SetPhysicsProperties.html#a22bea3bf369b87d15113cb3d76cf3ae3).ode_config.cfm                        = config.cfm                         ;
    02203           srv.[request](../../gazebo_msgs/html/structgazebo__msgs_1_1SetPhysicsProperties.html#a22bea3bf369b87d15113cb3d76cf3ae3).ode_config.erp                        = config.erp                         ;
    02204           srv.[request](../../gazebo_msgs/html/structgazebo__msgs_1_1SetPhysicsProperties.html#a22bea3bf369b87d15113cb3d76cf3ae3).ode_config.max_contacts               = config.max_contacts                ;
    02205           this->[physics_reconfigure_set_client_](classGazeboROSNode.html#a401861e9aa2d4421f34dc92411e41afd).[call](../../../api/roscpp/html/classros_1_1ServiceClient.html#ad7f2499f8fcdc6598e284bc6094d2d77)(srv);
    02206           [ROS_INFO](../../../api/rosconsole/html/macros__generated_8h.html#a20d5da22f16df09d52a7577227636a83)("physics dynamics reconfigure update complete");
    02207         }
    02208         [ROS_INFO](../../../api/rosconsole/html/macros__generated_8h.html#a20d5da22f16df09d52a7577227636a83)("physics dynamics reconfigure complete");
    02209       }
    02210     }
    02211
    [02212](classGazeboROSNode.html#aeeeaf330e57c06557910d62034bab2d5)     void [PhysicsReconfigureNode](classGazeboROSNode.html#aeeeaf330e57c06557910d62034bab2d5)()
    02213     {
    02214       [ros::NodeHandle](../../../api/roscpp/html/classros_1_1NodeHandle.html) node_handle;
    02215       this->[physics_reconfigure_set_client_](classGazeboROSNode.html#a401861e9aa2d4421f34dc92411e41afd) = node_handle.[serviceClient](../../../api/roscpp/html/classros_1_1NodeHandle.html#a3db491e71bcdd1d99f6cff789bd1adbc)<[gazebo_msgs::SetPhysicsProperties](../../gazebo_msgs/html/structgazebo__msgs_1_1SetPhysicsProperties.html)>("/gazebo/set_physics_properties");
    02216       this->[physics_reconfigure_get_client_](classGazeboROSNode.html#a7dd692c657f72627df72e9b765679a10) = node_handle.[serviceClient](../../../api/roscpp/html/classros_1_1NodeHandle.html#a3db491e71bcdd1d99f6cff789bd1adbc)<[gazebo_msgs::GetPhysicsProperties](../../gazebo_msgs/html/structgazebo__msgs_1_1GetPhysicsProperties.html)>("/gazebo/get_physics_properties");
    02217       this->[physics_reconfigure_set_client_](classGazeboROSNode.html#a401861e9aa2d4421f34dc92411e41afd).[waitForExistence](../../../api/roscpp/html/classros_1_1ServiceClient.html#a530e3f1d55cf50ab00b8e5bbd9e8230a)();
    02218       this->physics_reconfigure_get_client_.waitForExistence();
    02219
    02220       // for dynamic reconfigure physics
    02221       // for dynamic_reconfigure
    02222       dynamic_reconfigure::Server<gazebo::PhysicsConfig> physics_reconfigure_srv;
    02223       dynamic_reconfigure::Server<gazebo::PhysicsConfig>::CallbackType physics_reconfigure_f;
    02224
    02225       physics_reconfigure_f = boost::bind(&[GazeboROSNode::PhysicsReconfigureCallback](classGazeboROSNode.html#a03177cbae757eebae30cf03d7950d532), this, _1, _2);
    02226       physics_reconfigure_srv.setCallback(physics_reconfigure_f);
    02227
    02228       [ROS_INFO](../../../api/rosconsole/html/macros__generated_8h.html#a20d5da22f16df09d52a7577227636a83)("Starting to spin physics dynamic reconfigure node...");
    02229       [ros::Rate](../../../api/rostime/html/classros_1_1Rate.html) r(10);
    02230       while(ros::ok())
    02231       {
    02232         ros::spinOnce();
    02233         r.[sleep](../../../api/rostime/html/classros_1_1Rate.html#ae5664d27cda1b17a103347560259e945)();
    02234       }
    02235     }
    02236
    02237
    [02239](classGazeboROSNode.html#a3ed4d4489e1988232be63098587f5248)     [tf::TransformBroadcaster](../../../api/tf/html/classtf_1_1TransformBroadcaster.html) [tfbr](classGazeboROSNode.html#a3ed4d4489e1988232be63098587f5248 "broadcast transform between all models and the gazebo inertial "world"...");
    02240


#  [ Gazebo sim code concepts ](//gazebo214.rssing.com/chan-57893035/latest-
article21-live.php)


Launching this file, you should see the same results as when using ` rosrun `
.


Sorry, something went wrong.


      <!-- Gazebo model spawner -->
      <node name="spawn_turtlebot_model" pkg="gazebo_ros" type="spawn_model" output="screen"
            args="-urdf -param robot_description -model thorp
                  -x $(arg initial_pose_x)
                  -y $(arg initial_pose_y)
                  -Y $(arg initial_pose_a)
                  -J arm_shoulder_pan_joint 0.0
                  -J arm_shoulder_lift_joint 0
                  -J arm_elbow_flex_joint 2.2
                  -J arm_wrist_flex_joint 1.4
                  -J gripper_link_joint 0.0
                  -J cannon_joint 0.0
                  -unpause"/>  <!--  we spawn arm model on resting state -->

---

All reactions


The useful info would be the format for exporting model paths from a
package.xml:


#  [ Cannot locate rosdep definition for gz-transport12 and gz-math7 after
building Gazebo from source. ](//gazebo214.rssing.com/chan-57893035/latest-
article14-live.php)


Copy link


I thought it might be related to the 4 CPUs being a bit more busy than usual,
so I downloaded the ` stress ` program and found out as long at least 2 CPUs
were busy the rover stayed put. Perhaps it can be some obscure race condition
that I have.

---

All reactions


![Za Pakhtoon Yum: A mind-altering foray into Pukhtun life and
culture](//blogs.tribune.com.pk/application/../wp-
content/uploads/2014/10/24552-zpy-1414239961-635-160x120.jpg)


[ ![@k-okada](https://avatars.githubusercontent.com/u/493276?s=80&v=4)
](/k-okada)


[ ](javascript:; "Share Article") [
](//www.rssing.com/contact.php?r=o6&u=%2F%2Fgazebo214.rssing.com%2Fchan-57893035%2Flatest-
article14-live.php "Article Support")


We read every piece of feedback, and take your input very seriously.


**ROS Jade:**