apollo icon indicating copy to clipboard operation
apollo copied to clipboard

GNSS software setup

Open ghost opened this issue 8 years ago • 13 comments

Hello,

I would like to setup my GNSS to work with Apollo, I have;

  • a ProPak6 Triple-Frequency GNSS Receiver
  • an IMU-IGM-A1
  • 2 VEXXIS GNSS-500 Series Antennas

My hardware seems to match with your setup, thus, I don't believe I have to add a new GPS receiver to the project. After connecting all my hardware, I am capable to use Novatel connect as well as another Linux driver, I would now like to use Apollo's driver.

1. What do I need to setup software wise to get the driver to work with my hardware setup ? I believe part of the configuration work goes here, in the gnss_conf_mkz.txt file.

rtk_from {
    format: RTCM_V3
    ntrip {
        #address:
        #port:
        #mount_point:
        #user:
        #password:
        timeout_s: 5
    }
    push_location: true
}

If I try and launch the gnss_driver.launch file, I get the following errors,

/apollo/modules/drivers/gnss/src/stream/raw_stream.cpp:95 drivers::gnss::Stream* apollo::drivers::gnss::create_stream() [ERROR] [1515794160.915537427]: ntrip def has no address field.
/apollo/modules/drivers/gnss/src/stream/raw_stream.cpp:203 drivers::gnss::RawStream::init() [ERROR] [1515794160.915569184]: Failed to create rtk_from stream.
/apollo/modules/drivers/gnss/src/stream/stream_nodelet.cpp:70 drivers::gnss::StreamNodelet::onInit() [ERROR] [1515794160.915589561]: Init stream nodelet failed.
/apollo/modules/drivers/gnss/src/stream/stream_nodelet.cpp:71 drivers::gnss::StreamNodelet::onInit() [ERROR] [1515794160.915611338]: Init stream nodelet failed.

It look like an NTRIP server is related to the RTK technology, is it necessary to use RTK with Apollo ?

2. How does Apollo exploit the data ? Since Apollo is build on ROS, I would expect the drivers to publish the sensors data on topics to be subscribed by other modules, although, I haven't found any trace of relevant publish or subscribe in the various directory.

$ git status 
On branch master
Your branch is up-to-date with 'origin/master'.
$ docker -v
Docker version 17.05.0-ce, build 89658be

Please feel free to ask for details if my question is not clear enough. Thank you.

ghost avatar Jan 12 '18 22:01 ghost

@bbidault2 In the software we use ntrip setting as default as what you have pasted, and a ntrip RTK server is needed and you need to fulfill your own base station information. Please refer to https://github.com/ApolloAuto/apollo/blob/master/docs/quickstart/apollo_2_0_hardware_system_installation_guide%20v1.md for the detailed settings. Of course you can use other protocols, and can refer to https://www.novatel.com/assets/Documents/Manuals/OM-20000148.pdf and https://www.novatel.com/products/span-gnss-inertial-systems/span-combined-systems/span-igm-a1/ for more details.

Capri2014 avatar Jan 13 '18 04:01 Capri2014

Thank you for your answer @Capri2014. What about my second question, I have an other working driver at my disposition that comes with a ROS bridge, thus I might be able to use it instead of Apollo's driver. Although, before starting work in that direction I would like to be sure that it is useful. Do Apollo's modules and tools subscribe to a ROS topic to access the data (position, orientation, etc.) or does is exploit it in a different way ?
Thanks again.

ghost avatar Jan 15 '18 18:01 ghost

I contacted a local agency that provides a GNSS network with NTRIP capabilities. They provided me with an IP address, a port number, a mount point, a user ID and a password, although, after modifying the gnss_conf_mkz.txt file, I still have a same errors.

//apollo/modules/drivers/gnss/src/stream/raw_stream.cpp:95 drivers::gnss::Stream* apollo::drivers::gnss::create_stream() [ERROR] [1516151308.725199199]: ntrip def has no address field.
//apollo/modules/drivers/gnss/src/stream/raw_stream.cpp:203 drivers::gnss::RawStream::init() [ERROR] [1516151308.725254376]: Failed to create rtk_from stream.
//apollo/modules/drivers/gnss/src/stream/stream_nodelet.cpp:70 drivers::gnss::StreamNodelet::onInit() [ERROR] [1516151308.725288948]: Init stream nodelet failed.
//apollo/modules/drivers/gnss/src/stream/stream_nodelet.cpp:71 drivers::gnss::StreamNodelet::onInit() [ERROR] [1516151308.725326173]: Init stream nodelet failed.

ghost avatar Jan 17 '18 01:01 ghost

@bbidault2 can you double check if your /apollo/bazel-apollo/external/ros/share/gnss_driver/conf/gnss_conf_mkz.txt been updated as expected?

Capri2014 avatar Jan 18 '18 21:01 Capri2014

@Capri2014 Yes it's updated as expected. Here is how I set it up in /apollo/modules/drivers/gnss/launch/gnss_conf_mkz.txt,

data {
    format: NOVATEL_BINARY
    serial {
        device: "/dev/USB0"
        baud_rate: 115200
    }
}

rtk_from {
    format: RTCM_V3
    ntrip {
        #address: 167.131.109.57 
        #port: 9879
        #mount_point: Nearest_Single_RTCM3
        #user: _myusername_
        #password: _mypassword_
        timeout_s: 5
    }
    push_location: true
}

rtk_to {
    format: NOVATEL_BINARY
    serial {
        device: "/dev/USB1"
        baud_rate: 115200
    }
}

Does that look good ? My gnss appears as 3 USB devices, /dev/ttyUSB0, /dev/ttyUSB1 and /dev/ttyUSB2. What about my second question from my original post ? Thank you for your help.

ghost avatar Jan 18 '18 22:01 ghost

@bbidault2 You forgot to remove the # sign before in rtk_from { format: RTCM_V3 ntrip { #address: 167.131.109.57 #port: 9879 #mount_point: Nearest_Single_RTCM3 #user: _myusername_ #password: _mypassword_ timeout_s: 5 } push_location: true }

As of the second question, we do use publish and subscribe, see https://github.com/ApolloAuto/apollo/tree/master/modules/common/adapters for more details.

Capri2014 avatar Jan 18 '18 22:01 Capri2014

@Capri2014 Thank you for seeing that, it could have had taken me more time than I would admit.

I now have some errors, some related to the configuration.

[libprotobuf ERROR google/protobuf/text_format.cc:287] Error parsing text-format apollo.drivers.gnss.config.Config: 12:18: Expected string, got: 167.131
/apollo/modules/drivers/gnss/src/stream/raw_stream.cpp:156 drivers::gnss::RawStream::init() [ INFO] [1516316408.956275709]: Parse config context failed.
/apollo/modules/drivers/gnss/src/stream/stream_nodelet.cpp:70 drivers::gnss::StreamNodelet::onInit() [ERROR] [1516316408.956305596]: Init stream nodelet failed.
/apollo/modules/drivers/gnss/src/stream/stream_nodelet.cpp:71 drivers::gnss::StreamNodelet::onInit() [ERROR] [1516316408.956325567]: Init stream nodelet failed.
[libprotobuf ERROR google/protobuf/text_format.cc:287] Error parsing text-format apollo.drivers.gnss.config.Config: 12:25: Already saw decimal point or exponent; can't have another one.
[libprotobuf ERROR google/protobuf/text_format.cc:287] Error parsing text-format apollo.drivers.gnss.config.Config: 12:18: Expected string, got: 167.131
/apollo/modules/drivers/gnss/src/parser/data_parser.cpp:138 drivers::gnss::DataParser::init() [FATAL] [1516316409.247499272]: Failed to load config file: /home/tmp/ros/share/gnss_driver/conf/gnss_conf_mkz.txt
/apollo/modules/drivers/gnss/src/parser/parser_nodelet.cpp:79 drivers::gnss::ParserNodelet::onInit() [ERROR] [1516316409.247554540]: Init parser nodelet failed.
/apollo/modules/drivers/gnss/src/parser/parser_nodelet.cpp:80 drivers::gnss::ParserNodelet::onInit() [ERROR] [1516316409.247584882]: Init parser nodelet failed.

It is complaining that the my address is not a string, that might be a misunderstanding from my side, am I supposed to put an IP address or a web address like @silverland79 in #1882 did ?

ghost avatar Jan 18 '18 23:01 ghost

@bbidault2 it needs to be string, for instance address: "167.131.109.57"

Capri2014 avatar Jan 18 '18 23:01 Capri2014

@bbidault2 please see this one for more details: https://github.com/ApolloAuto/apollo/pull/2524

Capri2014 avatar Jan 18 '18 23:01 Capri2014

Thank you @Capri2014, I am slowly getting there, and yes, more documentation or more readable code is always a good thing ! Now I get a Permission denied when the driver tries to open the device. I have tried to change the permissions with chmod +x /dev/ttyUSB0 but it did not help.

/apollo/modules/drivers/gnss/src/stream/raw_stream.cpp:247 drivers::gnss::RawStream::init() [ WARN] [1516320406.914706121]: No login_commands in config file.
/apollo/modules/drivers/gnss/src/impl/stream/serial_stream.cpp:131 drivers::gnss::SerialStream::open() [ERROR] [1516320406.914759190]: Open device /dev/ttyUSB0 failed, error: Permission denied
/apollo/modules/drivers/gnss/src/stream/raw_stream.cpp:275 drivers::gnss::RawStream::connect() [ERROR] [1516320406.914798553]: data stream connect failed.
/apollo/modules/drivers/gnss/src/stream/raw_stream.cpp:256 drivers::gnss::RawStream::init() [ERROR] [1516320406.914817840]: gnss driver connect failed.
/apollo/modules/drivers/gnss/src/stream/stream_nodelet.cpp:70 drivers::gnss::StreamNodelet::onInit() [ERROR] [1516320406.914833525]: Init stream nodelet failed.
/apollo/modules/drivers/gnss/src/stream/stream_nodelet.cpp:71 drivers::gnss::StreamNodelet::onInit() [ERROR] [1516320406.914851970]: Init stream nodelet failed.

ghost avatar Jan 19 '18 00:01 ghost

@bbidault2 I recommend checking that the $USERis in the dialout group. You can check with the command groups.

This is typically set up by Docker, so you may have a different issue.

lyletbjohnson avatar Jan 19 '18 00:01 lyletbjohnson

Hey @lyletbjohnson. I have already tried that but it did not help. I believe the problem is in the permissions of SerialStream::open although it looks good to me. Thank you for your help though.

ghost avatar Jan 19 '18 01:01 ghost

So using chmod was the solution, I had to do sudo chmod 666 /dev/ttyUSB0. I still have some timeout issues but since the main goal of this issue was reached, I'll close it for now. Thanks again.

ghost avatar Jan 20 '18 01:01 ghost