ROS Resources: Documentation | Support | Discussion Forum | Index | Service Status | ros @ Robotics Stack Exchange
Ask Your Question

Revision history [back]

I could not find out quickly, how the rover model from Erlerobot generates GPS data, but you could try to use the simulated GPS device from hector_gazebo_plugins instead. That one works pretty well.

To install hector_gazebo_plugins use:

$ sudo apt-get install ros-DISTRIBUTION-hector-gazebo-plugins

Afterwards add the following lines inside your <robot><gazebo> </gazebo></robot> tags of your URDF file (or <model> </model>, if you are using SDF):

<plugin name="gps_controller" filename="libhector_gazebo_ros_gps.so">
    <alwayson>true</alwayson>
    <updaterate>1.0</updaterate>
    <bodyname>base_link</bodyname>
    <topicname>/fix</topicname>
    <velocitytopicname>/fix_velocity</velocitytopicname>
    <drift>5.0 5.0 5.0</drift>
    <gaussiannoise>0.1 0.1 0.1</gaussiannoise>
    <velocitydrift>0 0 0</velocitydrift>
    <velocitygaussiannoise>0.1 0.1 0.1</velocitygaussiannoise>
</plugin>

The hector plugin above generates sensor_msgs/NavSatFix messages. If ardupilot really requires gps_common/GPSFix messages, you can find a script, which converts between those two messages here.

I could not find out quickly, how the rover model from Erlerobot generates GPS data, but you could try to use the simulated GPS device from hector_gazebo_plugins instead. That one works pretty well.

To install hector_gazebo_plugins use:

$ sudo apt-get install ros-DISTRIBUTION-hector-gazebo-plugins

Afterwards add the following lines inside your <robot><gazebo> </gazebo></robot> tags of your URDF file (or <model> </model>, if you are using SDF):

<plugin name="gps_controller" filename="libhector_gazebo_ros_gps.so">
    <alwayson>true</alwayson>
    <updaterate>1.0</updaterate>
    <bodyname>base_link</bodyname>
    <topicname>/fix</topicname>
    <velocitytopicname>/fix_velocity</velocitytopicname>
    <drift>5.0 5.0 5.0</drift>
    <gaussiannoise>0.1 0.1 0.1</gaussiannoise>
    <velocitydrift>0 0 0</velocitydrift>
    <velocitygaussiannoise>0.1 0.1 0.1</velocitygaussiannoise>
</plugin>

The hector plugin above generates sensor_msgs/NavSatFix messages. If ardupilot really requires gps_common/GPSFix messages, you can find a script, which converts between those two messages here.

use the fix_translator in the gps_common package to do the conversion. The best way to use the translator ist to adapt the fix_tanslator.launch file to the topic names on your system.

I could not find out quickly, how the rover model from Erlerobot generates GPS data, but you could try to use the simulated GPS device from hector_gazebo_plugins instead. That one works pretty well.

To install hector_gazebo_plugins use:

$ sudo apt-get install ros-DISTRIBUTION-hector-gazebo-plugins

Afterwards add the following lines inside your <robot><gazebo> </gazebo></robot> tags of your URDF file (or <model> </model>, if you are using SDF):

<plugin name="gps_controller" filename="libhector_gazebo_ros_gps.so">
    <alwayson>true</alwayson>
    <updaterate>1.0</updaterate>
    <bodyname>base_link</bodyname>
    <topicname>/fix</topicname>
    <velocitytopicname>/fix_velocity</velocitytopicname>
    <drift>5.0 5.0 5.0</drift>
    <gaussiannoise>0.1 0.1 0.1</gaussiannoise>
    <velocitydrift>0 0 0</velocitydrift>
    <velocitygaussiannoise>0.1 0.1 0.1</velocitygaussiannoise>
</plugin>

The hector plugin above generates sensor_msgs/NavSatFix messages. If ardupilot really requires gps_common/GPSFix messages, you can use the fix_translator fix_translator script in the gps_common package to do the conversion. The best way to use the translator ist to adapt the fix_tanslator.launch file to the topic names on your system.