[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);