前往小程序,Get更优阅读体验!
立即前往
首页
学习
活动
专区
工具
TVP
发布
社区首页 >专栏 >autoware 代码阅读 sensor

autoware 代码阅读 sensor

作者头像
用户1908973
发布2018-07-24 16:04:03
1.3K0
发布2018-07-24 16:04:03
举报
文章被收录于专栏:CreateAMindCreateAMind

Read Code

  • follow sensor data flow
  • focus on sensor type,driver,data processing,ros topic
1.GNNS sensing>drivers>GNNS

1.1 driver basic

ROS driver to parse NMEA strings and publish standard ROS NavSat message types. Does not require the GPSD daemon to be running. http://wiki.ros.org/nmea_navsat_driver

Supported GPS Devices: http://wiki.ros.org/nmea_navsat_driver/SupportedHardware

Venus

Venus634LPx

Yes

GGA, GSA, RMC

SBAS

works

Garmin

GPS 18x

Yes

GGA, GSA, RMC

SBAS

works

1.2 node and topic ,data flow

  • nmea_topic_serial_reader :

Reads NMEA sentences from the specified serial port and publishes them to a ROS topic.

代码语言:javascript
复制
Published Topics:
    nmea_sentence (nmea_msgs/Sentence) :
        A single time-stamped NMEA sentence captured from the serial device 
Parameters:
    port (string, default: /dev/ttyUSB0) 
        The device path 

    baud (int, default: 4800) 
        The baud rate to receive NMEA data. 

    frame_id (string, default: gps) 
        The frame_id for the header of the nmea_msgs/Sentence and output message. 
        Will be resolved with tf_prefix if defined.
  • nmea_serial_driver: NMEA GPS Serial driver node.

NMEA GPS Serial driver node.

代码语言:javascript
复制
Published Topics:
    fix (sensor_msgs/NavSatFix)
        GPS position fix reported by the device. 
        This will be published with whatever positional and status data was available 
        even if the device doesn't have a valid fix. Invalid fields may contain NaNs. 

    vel (geometry_msgs/TwistStamped)
        Velocity output from the GPS device. 
        Only published when the device outputs  valid velocity information. 
        The driver does not calculate the velocity based on only position fixes. 

    time_reference (sensor_msgs/TimeReference)
        The timestamp from the GPS device is used as the time_ref.

Parameters:
    ~port (string, default: /dev/ttyUSB0)
        The device path 

    ~baud (int, default: 4800)
        The baud rate to receive NMEA data. 

    ~frame_id (string, default: gps)
        The frame_id for the header of the sensor_msgs/NavSatFix and geometry_msgs/TwistStamped output messages. 
        Will be resolved with tf_prefix if defined. 

    ~time_ref_source (string, default: <the value of ~frame_id>)
        The value to use as the source in the sensor_msgs/TimeReference. 

    ~useRMC (bool, default: False)
        Whether to generate position fixes from GGA sentences or RMC sentences.
  • nmea_topic_driver

NMEA GPS Topic driver node. Reads NMEA sentences from a ROS topic instead of directly from e.g. a serial port.

代码语言:javascript
复制
Subscribed Topics
    nmea_sentence (nmea_msgs/Sentence)
        NMEA sentences, 1 per message. 
        These sentences do not have to be checksummed or otherwise validated before reaching the driver. 
Published Topics:
    fix (sensor_msgs/NavSatFix)
        GPS position fix reported by the device. 
        This will be published with whatever positional and status data was available even if the device doesn't have a valid fix.
         Invalid fields may contain NaNs. 

    vel (geometry_msgs/TwistStamped)
        Velocity output from the GPS device. Only published when the device outputs valid velocity information. 
        The driver does not calculate the velocity based on only position fixes. 

    time_reference (sensor_msgs/TimeReference)
        The timestamp from the GPS device is used as the time_ref.

1.3 into code

nmea_navsat is just source file fork from github.useless.

dive into javad_navsat_driver :

1.3.1 lauch file

代码语言:javascript
复制
<launch> 

  <arg name="port" default="/dev/ttyUSB0"/>
  <arg name="baud" default="57600" />
  <arg name="enable_file" default="$(find javad_navsat_driver)/cfg/enable.cfg"/>
  <arg name="disable_file" default="$(find javad_navsat_driver)/cfg/disable.cfg"/>

  <!-- HOW TO RUN using rosrun:-->
  <!-- rosrun nmea_navsat_driver nmea_topic_serial_driver _port:=/dev/ttyUSB0 _baud:=57600 -->
 <!-- rosrun nmea_navsat_driver nmea_topic_driver -->

<!--read sentence and publish topic-->
<node pkg="javad_navsat_driver" type="javad_topic_serial_reader" name="javad_topic_serial_reader" output="log">
  <param name="port" value="$(arg port)" />
  <param name="baud" value="$(arg baud)" />
  <param name="enable_file" value="$(arg enable_file)" />
  <param name="disable_file" value="$(arg disable_file)" />
</node>

<!--subscribe topic-->
<node pkg="javad_navsat_driver" type="javad_topic_driver" name="javad_topic_driver"> 
</node>

</launch>

start two nodes: javad_topic_serial_reader and javad_topic_driver

set Parameters :port,baud

1.3.2 javad_topic_serial_reader

read GPS data from device via serial ,and publish topic "nmea_sentence"

1.3.3javad_topic_driver

Subscriber "nmea_sentence", check sum to verify validation of sentence,

publish current_vel,current_fix,current_time_ref

2.can sensing>drivers>GNNS

2.1 driver basic

kvaser is a software product from KVASER that provides support for different CAN interface boards.

http://www.kvaser.com/canlib-webhelp/page_user_guide_intro_what.html

must install CANlib first ,then you can build this package!!!

support device: https://www.kvaser.com/product/kvaser-leaf-light-hs-v2-obdii/

The Leaf Light v2 OBDII provides a simple way of connecting a PC with a vehicle’s on-board computer by means of USB 2.0 connector and a 16-pin OBDII-compliant CAN connector. Having made its name as the work-horse of USB to CAN interfaces, Kvaser's Leaf Light product series provides reliable, low cost tools for connecting any CAN network to a PC or mobile computer in vehicle diagnostic applications and beyond.

2.2 into package

2.2.1 msg

only use CANPacket.msg

2.2.2can_listener

set communication parameter with kvaser device,

read can data and publish "can_raw"

2.2.3 can_converter

subscribe "can_raw",convert to real value ,save to log /tmp/can_log

2.2.4 can_draw

subscribe "can_raw",convert to real value ,save to log /tmp/can_log,

publish "can_status",type Marker, ?????

代码语言:javascript
复制
    line_list.header.frame_id = "velodyne";
    line_list.header.stamp = ros::Time::now();
    line_list.ns = "steer_speed";
    line_list.action = visualization_msgs::Marker::ADD;
    line_list.pose.orientation.w = 1.0;
    //  line_list.lifetime=ros::Duration(0.2);

    line_list.id = 0;
    line_list.type = visualization_msgs::Marker::LINE_LIST;
    line_list.scale.x = 0.2;
    line_list.color.r = 1.0;
    line_list.color.g = 0.0;
    line_list.color.b = 0.0;
    line_list.color.a = 1;
3. camera sensing>drivers>camera

3.1 support camera

3.1.1 VLG-22C.I

VLG-22C.I

-

Camera Series:

VisiLine

FPS:

55

Interface:

GigE

Manufacturer:

Baumer

Resolutions:

2.2 MP

Scanning Mode:

-

Signal System:

Digital Color

camera drive :BaumerGAPI

lauch file

代码语言:javascript
复制
<launch>
    <!-- declare arguments with default values -->
    <arg name="fps" default="15"/>
    <arg name="CalibrationFile" default=""/>

    <node pkg="vlg22c_cam" type="vlg22c_cam_node" name="vlg22c" cwd="node">
        <param name="fps" value="$(arg fps)"/>
        <param name="calibrationfile" value="$(arg CalibrationFile)"/>
    </node>
</launch>

set parameter fps,CalibrationFile

start node :vlg22c_cam_node

initilize camera system,get device info eg.camera number,system number

for each camera,publish "image_raw1", "image_raw2"....

3.2

本文参与 腾讯云自媒体分享计划,分享自微信公众号。
原始发表:2017-06-18,如有侵权请联系 cloudcommunity@tencent.com 删除

本文分享自 CreateAMind 微信公众号,前往查看

如有侵权,请联系 cloudcommunity@tencent.com 删除。

本文参与 腾讯云自媒体分享计划  ,欢迎热爱写作的你一起参与!

评论
登录后参与评论
0 条评论
热度
最新
推荐阅读
目录
  • Read Code
领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档