Home | Tutorials | Wiki | Issues
Ask Your Question

nzlz's profile - activity

2019-01-15 11:43:40 -0600 received badge  Popular Question (source)
2019-01-15 05:22:13 -0600 marked best answer no matching function for call to ‘rclcpp::AnyServiceCallback<gazebo_msgs::srv::GetModelList>::set

I am porting get_world_properties to ros2 with the name get_model_list, and I am facing the following error in the updated gazebo_ros_factory.cpp.

The new update mainly contains a new GetModelList.srv (empty request, possible cause of the error?) and a GetModelList function in the gazebo_ros_factory plugin. I suspect the error is somewhere in the creation of the new service (model_list_service_ = ros_node_->create_service .......).

The whole code is available at: https://github.com/nzlz/gazebo_ros_pk...

Thanks in advance!

Error:

nestor@n-pc:~/gz_ws_ros2$ colcon build --merge-install --packages-select gazebo_ros
Starting >>> gazebo_ros
--- stderr: gazebo_ros                             
In file included from /opt/ros/crystal/include/rclcpp/node_impl.hpp:42:0,
                 from /opt/ros/crystal/include/rclcpp/node.hpp:492,
                 from /opt/ros/crystal/include/rclcpp/executors/single_threaded_executor.hpp:28,
                 from /opt/ros/crystal/include/rclcpp/executors.hpp:22,
                 from /opt/ros/crystal/include/rclcpp/rclcpp.hpp:144,
                 from /home/nestor/gz_ws_ros2/src/gazebo_ros_pkgs/gazebo_ros/include/gazebo_ros/node.hpp:18,
                 from /home/nestor/gz_ws_ros2/src/gazebo_ros_pkgs/gazebo_ros/src/gazebo_ros_factory.cpp:28:
/opt/ros/crystal/include/rclcpp/create_service.hpp: In instantiation of ‘typename rclcpp::Service<ServiceT>::SharedPtr rclcpp::create_service(std::shared_ptr<rclcpp::node_interfaces::NodeBaseInterface>, std::shared_ptr<rclcpp::node_interfaces::NodeServicesInterface>, const string&, CallbackT&&, const rmw_qos_profile_t&, rclcpp::callback_group::CallbackGroup::SharedPtr) [with ServiceT = gazebo_msgs::srv::GetModelList; CallbackT = std::_Bind<void (gazebo_ros::GazeboRosFactoryPrivate::*(gazebo_ros::GazeboRosFactoryPrivate*, std::_Placeholder<2>))(std::shared_ptr<gazebo_msgs::srv::GetModelList_Response_<std::allocator<void> > >)>; typename rclcpp::Service<ServiceT>::SharedPtr = std::shared_ptr<rclcpp::Service<gazebo_msgs::srv::GetModelList> >; std::__cxx11::string = std::__cxx11::basic_string<char>; rmw_qos_profile_t = rmw_qos_profile_t; rclcpp::callback_group::CallbackGroup::SharedPtr = std::shared_ptr<rclcpp::callback_group::CallbackGroup>]’:
/opt/ros/crystal/include/rclcpp/node_impl.hpp:201:53:   required from ‘typename rclcpp::Service<ServiceT>::SharedPtr rclcpp::Node::create_service(const string&, CallbackT&&, const rmw_qos_profile_t&, rclcpp::callback_group::CallbackGroup::SharedPtr) [with ServiceT = gazebo_msgs::srv::GetModelList; CallbackT = std::_Bind<void (gazebo_ros::GazeboRosFactoryPrivate::*(gazebo_ros::GazeboRosFactoryPrivate*, std::_Placeholder<2>))(std::shared_ptr<gazebo_msgs::srv::GetModelList_Response_<std::allocator<void> > >)>; typename rclcpp::Service<ServiceT>::SharedPtr = std::shared_ptr<rclcpp::Service<gazebo_msgs::srv::GetModelList> >; std::__cxx11::string = std::__cxx11::basic_string<char>; rmw_qos_profile_t = rmw_qos_profile_t; rclcpp::callback_group::CallbackGroup::SharedPtr = std::shared_ptr<rclcpp::callback_group::CallbackGroup>]’
/home/nestor/gz_ws_ros2/src/gazebo_ros_pkgs/gazebo_ros/src/gazebo_ros_factory.cpp:141:29:   required from here
/opt/ros/crystal/include/rclcpp/create_service.hpp:43:3: error: no matching function for call to ‘rclcpp::AnyServiceCallback<gazebo_msgs::srv::GetModelList>::set(std::_Bind<void (gazebo_ros::GazeboRosFactoryPrivate::*(gazebo_ros::GazeboRosFactoryPrivate*, std::_Placeholder<2>))(std::shared_ptr<gazebo_msgs::srv::GetModelList_Response_<std::allocator<void> > >)>)’
   any_service_callback.set(std::forward<CallbackT>(callback));
   ^~~~~~~~~~~~~~~~~~~~
In file included from /opt/ros/crystal/include/rclcpp/service.hpp:27:0,
                 from /opt/ros/crystal/include/rclcpp/callback_group.hpp:24,
                 from /opt/ros/crystal/include/rclcpp/any_executable.hpp:20,
                 from /opt/ros/crystal/include/rclcpp/memory_strategy.hpp:24,
                 from /opt/ros/crystal/include/rclcpp/memory_strategies.hpp:18,
                 from /opt/ros/crystal/include/rclcpp/executor.hpp:32,
                 from /opt/ros/crystal/include/rclcpp/executors/multi_threaded_executor.hpp:24,
                 from /opt/ros/crystal/include/rclcpp/executors.hpp:21,
                 from /opt/ros/crystal/include/rclcpp/rclcpp.hpp:144,
                 from /home/nestor/gz_ws_ros2/src/gazebo_ros_pkgs/gazebo_ros/include/gazebo_ros/node.hpp:18,
                 from /home/nestor/gz_ws_ros2/src/gazebo_ros_pkgs/gazebo_ros/src ...
(more)
2019-01-15 05:21:54 -0600 received badge  Commentator
2019-01-15 05:21:54 -0600 commented answer no matching function for call to ‘rclcpp::AnyServiceCallback<gazebo_msgs::srv::GetModelList>::set

That worked, thanks!

2019-01-14 06:29:26 -0600 asked a question no matching function for call to ‘rclcpp::AnyServiceCallback<gazebo_msgs::srv::GetModelList>::set

no matching function for call to ‘rclcpp::AnyServiceCallback<gazebo_msgs::srv::getmodellist>::set I am porting get

2019-01-07 05:08:24 -0600 marked best answer [ros2] reset_world/reset_simulation fail with URDF

Hi everyone,

First of all I'm not sure if its correct to comment a still not accepted PR, so I'm just leaving this here. This is about Port time commands (pause / reset) PR.

I want to be able to reset my robot, but I'm not achieving the desired results with neither /reset_world nor /reset_simulation. Images are self explanatory, only the pure gazebo model works as expected, not the urdf.

  • In reset_world MARA model is not affected.
  • In reset_simulation MARA loses all joint forces, or something like that.

reset_world

reset_world

reset_simulation

reset_simulation

2019-01-07 05:08:12 -0600 commented answer [ros2] reset_world/reset_simulation fail with URDF

Thanks!! Removing negative time check + Adding initialization variables to Reset() fixed the issue. reset_simulation is

2019-01-04 15:52:36 -0600 received badge  Famous Question (source)
2019-01-04 09:39:18 -0600 commented answer [ros2] reset_world/reset_simulation fail with URDF

I want to mention also that I don't get any console error. The last message is:

2019-01-04 09:38:50 -0600 commented answer [ros2] reset_world/reset_simulation fail with URDF

The plugin I'm using is probably the failing part. But I really don't know how to proceed or what could be failing. (Res

2019-01-03 19:10:15 -0600 received badge  Notable Question (source)
2019-01-03 12:46:04 -0600 received badge  Popular Question (source)
2019-01-03 12:34:06 -0600 received badge  Supporter (source)
2019-01-03 10:30:22 -0600 asked a question [ros2] reset_world/reset_simulation fail with URDF

[ros2] reset_world/reset_simulation fail with URDF Hi everyone, First of all I'm not sure if its correct to comment a s

2018-12-24 07:37:03 -0600 commented answer SITL Gazebo, Reset model using code

I checked the code at gym-gazebo and APM is just launched again, from scratch. You could use delete_model and spawn_urdf

2018-12-21 02:56:43 -0600 answered a question SITL Gazebo, Reset model using code

A good way of resetting the simulation is to make use of the /gazebo/reset_world service provided by gazebo_ros_packages

2017-07-28 03:22:20 -0600 received badge  Famous Question (source)
2017-03-29 21:49:50 -0600 received badge  Famous Question (source)
2016-11-11 14:20:33 -0600 received badge  Notable Question (source)
2016-11-11 14:20:32 -0600 received badge  Popular Question (source)
2016-10-17 15:25:02 -0600 received badge  Famous Question (source)
2016-10-17 15:24:50 -0600 received badge  Notable Question (source)
2016-10-17 15:24:50 -0600 received badge  Popular Question (source)
2016-10-17 15:23:27 -0600 asked a question Model plugin resets model pose

Hi,

I am trying to change the position of my catapult model dynamically. I am able to change the pose but when I send a message to the plugin the model gets bugged. Any idea how to fix the following code so that the plugin does not affect the model pose? Full plugin available here .

public: void OnRosMsg(const catapult_control::CatapultConstPtr &_msg)
{
  this->SetVelocity(_msg->velocity);
  this->SetUpperLimit(_msg->upper_limit);
}

public: void SetVelocity(const double &_vel)
{
  this->model->GetJointController()->SetVelocityTarget(
      this->joint->GetScopedName(), _vel);
}

public: void SetUpperLimit(const double &_upper_limit)
{
  this->joint->SetHighStop(0,_upper_limit);
}
2016-09-26 11:16:17 -0600 received badge  Student (source)
2016-09-26 10:12:59 -0600 commented answer <gazebo reference=""> not loaded from urdf.xacro Gazebo6

Can you share your URDF file?

2016-09-26 08:21:59 -0600 commented answer <gazebo reference=""> not loaded from urdf.xacro Gazebo6

The URDF I tested is the following: https://gist.github.com/Nestor94Gonzalez/877adf2b7e63dda66ad0f3bc7f02096a . I just place that code before the final </robot> tag. Make sure you see 'wheel_f_l' as a model link in gazebo (some links are not visible in gazebo when using urdf). If the problem is the uri, you can replace the script part with this code: https://gist.github.com/Nestor94Gonzalez/54c7af6f134e2072d304e316d4ea9d88 .

2016-09-26 06:26:43 -0600 answered a question SetUpperLimit in plugin

Late, but someone may find this useful. Just use SetHighStop instead of SetUpperLimit. (works in gazebo 7)

2016-09-26 05:38:03 -0600 answered a question <gazebo reference=""> not loaded from urdf.xacro Gazebo6

The following code works for me:

  <gazebo reference="wheel_f_l">
    <visual>
      <material>
        <script>
          <uri>file://media/materials/scripts/gazebo.material</uri>
          <name>Gazebo/Black</name>
        </script>
        <emissive>0 0 0 1</emissive>
      </material>
    </visual>
  </gazebo>
2016-09-26 05:09:30 -0600 received badge  Scholar (source)
2016-09-26 05:07:37 -0600 answered a question Changing physics engine through URDF

The easiest thing is to change the .world file you are launching. There you can specify the physics engine and the maximum_step_size. You can add the following code to your world file if you want to speed up simulation to the maximum:

<physics type='ode'>
  <max_step_size>0.01</max_step_size>
  <real_time_factor>1</real_time_factor>
  <real_time_update_rate>0</real_time_update_rate>
  <gravity>0 0 -9.8</gravity>
</physics>
2016-09-24 19:37:25 -0600 received badge  Notable Question (source)
2016-09-24 03:41:20 -0600 commented answer Properly restarting the gazebo simulation for iterative learning

If you don't spawn the robot again each iteration, all the small computation errors that have to do with the model will will create a larger error at the end. I don't think iterative learning is viable in gazebo if you don't at least update the pose of the robot manually.

2016-09-24 03:10:31 -0600 edited answer Properly restarting the gazebo simulation for iterative learning

You have an example here : https://github.com/erlerobot/gym-gaze... If you are using iterative learning I recommend you to use the toolkit and follow that code structure.

2016-09-23 16:02:45 -0600 received badge  Self-Learner (source)
2016-09-23 16:02:45 -0600 received badge  Teacher (source)
2016-09-23 09:51:14 -0600 answered a question Nondeterministic ball bounce[SOLVED]

After testing different parameters changing the following seems to be a decent fix:

Gazebo->Physics->solver->iterations = 100 (default is 50)

2016-09-23 08:52:46 -0600 commented answer Nondeterministic ball bounce[SOLVED]

The timing is the same (or almost) since the ball is automatically launched when I reset the simulation. About the physics engine, I wasn't able to make the ball bounce using bullet.

2016-09-23 05:59:47 -0600 received badge  Editor (source)
2016-09-23 05:59:47 -0600 edited question Nondeterministic ball bounce[SOLVED]

Hello,

I am getting different behaviors with exactly the same execution and world settings. As you can see in this video , I reset the world every time and launch the ball with exactly the same velocity. This happens when launching the ball against any kind of surface (not only this board).

Update: more videos: vid2, vid3.

Ball model.sdf file:

<?xml version="1.0" ?>
<sdf version="1.5">
  <model name="basketball">
    <static>false</static>
    <self_collide>true</self_collide>
    <link name="ball">
      <inertial>
        <mass>0.25</mass>
        <!-- inertia based on solid sphere 2/5 mr^2 -->
        <inertia>
          <ixx>0.00169</ixx>
          <iyy>0.00169</iyy>
          <izz>0.00169</izz>
          <ixy>0</ixy>
          <ixz>0</ixz>
          <iyz>0</iyz>
        </inertia>
      </inertial>
      <visual name="visual">
        <geometry>
          <sphere>
            <radius>0.13</radius>
          </sphere>
        </geometry>
      </visual>
      <collision name="collision">
        <geometry>
          <sphere>
            <radius>0.13</radius>
          </sphere>
        </geometry>
        <surface>
          <bounce>
            <restitution_coefficient>0.5</restitution_coefficient>
            <threshold>0.1</threshold>
          </bounce>
          <contact>
            <ode>
              <max_vel>5</max_vel>
              <min_depth>0.0001</min_depth>
            </ode>
          </contact>
        </surface>
      </collision>
    </link>
  </model>
</sdf>
2016-09-23 04:09:32 -0600 received badge  Popular Question (source)
2016-09-23 03:55:33 -0600 received badge  Enthusiast