osrf / vrx

Virtual RobotX (VRX) resources.
Apache License 2.0
387 stars 178 forks source link

Problem with reading the position of wam-v #739

Open KonradUr opened 9 months ago

KonradUr commented 9 months ago

Hi,

for testing with my own controllers, I need information about the wamv's position.

Using ROS1 + Gazebo11 it works in general properly:

rostopic echo /gazebo/model_states/pose[17]

It was more difficult with ROS2 and Gazebo Garden to get it moving, but after a few more installations in the docker, thrusters also started up.

Now, in ROS2 and Gazebo Garden I don't know how to read the current position. The elements of the group

/wamv/pose

return either fixed values or other than "pose" in the "component inspector" in GazeboSim. How to read the position of the device correctly? BTW: GPS and IMU readings are working properly.

kulkarni-raunak commented 7 months ago

You need to enable the ground truth flag in the file wamv_gazebo.urdf.xacro.

<xacro:arg name="ground_truth_enabled" default="true" />
KonradUr commented 7 months ago

Thanks for your help. Will this modification add fields for /wamv/pose? Because I still can't find something like .../pose/position?

kulkarni-raunak commented 7 months ago

After you enable the ground truth flag, look for topic /wamv/sensors/position/ground_truth_odometry

KonradUr commented 7 months ago

I have no such topic like /wamv/sensors/position/... . Does anything else need to be done/compiled/whatever after changing the xacro content before relaunching the world?

kulkarni-raunak commented 7 months ago

No. For me it works by just enabling the ground_truth_enabled flag.

May be try building the package again and then launch the world.

KonradUr commented 7 months ago

It started working after installing the latest versions: Gazebo Garden, ROS Humble and vrx. What's more, the current version on my machine shows 90% "simulation speed," while the older version (less than a year old) shows only 60%. So it was worth refreshing the model.
Thanks for your help.

sontung1010 commented 3 months ago

Hi I added the ground truth flag as above instruction but nothing shows up on my rqt graph for ros2 humble. Can you please help me with this?

kulkarni-raunak commented 3 months ago

@sontung1010 Is the topic available for you via ros2 topic list?

Maybe post your rqt-graph here.