-
Notifications
You must be signed in to change notification settings - Fork 771
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[ROS2] Unable to get object pose with /get_entity_state
service
#1287
Comments
@nicholaspalomo Hello, did you solve this problem? Now I myself need to implement this service. And I would like to know your feedback. At the moment, I need to contact this service, but I don’t even see it when |
Hi, I was trying to get this working as well, but also could not see the A workaround I used was to embed the <plugin name="p3d_base_footprint" filename="libgazebo_ros_p3d.so">
<ros>
<namespace>$(arg prefix)</namespace>
<remapping>odom:=$(arg prefix)_odom</remapping>
</ros>
<always_on>true</always_on>
<update_rate>100</update_rate>
<body_name>$(arg prefix)_base_footprint</body_name>
<frame_name>world</frame_name>
<gaussian_noise>0.00</gaussian_noise>
<xyz_offset>0 0 0</xyz_offset>
<rpy_offset>0 0 0</rpy_offset>
</plugin> I was working on a multi-robot example and thus needed to start each plugin in its own namespace. The message topics can also be remapped. The plugin publishes nav_msgs/Odometry messages on the selected topic. However, this does not publish any TF messages, so I guess you have to write a TF publisher node that subscribes to the topic that was specified earlier. My actual application was to get the ground truth positions of diff drive robots in my Gazebo environment, so a more direct solution was using an option in the diff drive controller source. Setting the If you set An example of what I did: <!-- ++++++++++++++++++++++++++++++ Diff Drive Plugin ++++++++++++++++++++++++++++ -->
<plugin name="$(arg prefix)_diff_drive" filename="libgazebo_ros_diff_drive.so">
<ros>
<remapping>/tf:=tf</remapping>
<namespace>$(arg prefix)</namespace>
</ros>
<always_on>true</always_on>
<update_rate>100</update_rate>
<left_joint>$(arg prefix)_left_wheel_joint</left_joint>
<right_joint>$(arg prefix)_right_wheel_joint</right_joint>
<wheel_separation>${chassis_y+wheelwidth+2*wheelgap}</wheel_separation>
<wheel_diameter>${wheeldiam}</wheel_diameter>
<max_wheel_torque>20</max_wheel_torque>
<max_wheel_acceleration>1.0</max_wheel_acceleration>
<odometry_frame>$(arg prefix)odom</odometry_frame>
<robot_base_frame>$(arg prefix)_base_footprint</robot_base_frame>
<!-- 0 is encoder, 1 is world (ground truth) -->
<odometry_source>1</odometry_source>
<publish_odom>true</publish_odom>
<publish_odom_tf>true</publish_odom_tf>
<publish_wheel_tf>true</publish_wheel_tf>
</plugin>
<!-- +++++++++++++++++++++++++++++ Joint State Plugin ++++++++++++++++++++++++++++ -->
<plugin name="$(arg prefix)_joint_states" filename="libgazebo_ros_joint_state_publisher.so">
<ros>
<namespace>$(arg prefix)</namespace>
</ros>
<joint_name>$(arg prefix)_right_wheel_joint</joint_name>
<joint_name>$(arg prefix)_left_wheel_joint</joint_name>
<update_rate>100</update_rate>
</plugin> I hope this helps! |
Hi, I was also trying to read the robot pose from gazebo and could not find the /get_entity_state service. I found a workaround, which is to add the |
Description
ROS2 hangs upon calling
/get_entity_state
message to query pose information about model spawned in Gazebo.To Reproduce
Steps to reproduce the behavior:
source /opt/ros/foxy/setup.bash
ros2 launch gazebo_ros gazebo.launch.py
gzclient
)Expected behavior
/get_entity_state
should return aGetEntityState.Response
containing the pose information about the cube (or whatever object) you spawn in Gazebo.Environment:
The text was updated successfully, but these errors were encountered: