系统环境:
- Ubuntu18.04.5 LTS
- Kernel 4.9.140-tegra
- ROS melodic 1.14.11
硬件:
- NUC8 i7-8650U
- Advanced Navigation Spatial + Tallysman GPS
文件:
待解决问题:
- Spatial 九轴陀螺仪有ROS包,官方(MIT)提供的包发现CPU占用过高,Github上有另外fork,但是放到ROS_ws编译不通过,先放着
- ROS包里面没发现GPS,后续查看
NavSatFix
Official website: Spatial
ROS wiki: advanced_navigation_driver
来源有两种:
http://wiki.ros.org/advanced_navigation_driver (CPU占用过高)
https://github.com/kylerlaird/advanced_navigation_driver (编译不通过)
测试:
rosrun advanced_navigation_driver advanced_navigation_driverAdvanced Navigation 提供的JAR工具包
文件: SpatialManager-5.8.jar
sudo java -jar SpatialManager-5.8.jar Packet to Published Message Example Copyright 2017, Advanced Navigation
This is an example using the Advanced Navigation Spatial SDK to create a ROS driver that reads and decodes the anpp packets (in this case packet #20 and packet #27) and publishes the information as ROS topics / messages.
It should work on all Advanced Navigation INS devices.
This example has been developed and tested using Ubuntu Linux v16.04 LTS and ROS Lunar. Installation instructions for ROS can be found here: http://wiki.ros.org/lunar/Installation/Ubuntu.
If you require any assistance using this code, please email support@advancednavigation.com.au.
ROS driver build instructions from: http://www.clearpathrobotics.com/assets/guides/ros/Creating%20publisher.html#creating-a-workspace-package
- Open a new Terminal window and type:
mkdir ~/ros [enter]. - Type:
mkdir ~/ros/src [enter]. - Type:
cd ~/ros/src [enter]. - Type:
catkin_init_workspace [enter]. - Type:
catkin_create_pkg advanced_navigation_driver roscpp std_msgs [enter]. - Copy the supplied
srcdirectory and thepackage.xmlfile into the~/ros/src/advanced_navigation_driverdirectory. It should be OK to overwrite the existingpackage.xmlfile if you are following these instructions explicitly. If installing into your own pre-existing catkin workspace it may be necessary to manually merge the contents of these files. - Modify the
package.xmlfile in ~/ros/src/an_driver directory as required. - Copy the supplied
CMakeLists.txtfile into the~/ros/src/advanced_navigation_driverdirectory, or modify the exisitng CMakeLists.txt file in the~/ros/src/advanced_navigation_driverdirectory by adding two lines at the end (you may need to modify the paths to suit your installation):add_executable(advanced_navigation_driver src/an_driver.cpp src/spatial_packets.c src/an_packet_protocol src/rs232/rs232.c) target_link_libraries(advanced_navigation_driver ${catkin_LIBRARIES}) - Type:
cd ~/ros[enter]. - Type:
catkin_make[enter].
To use this example code, your Advanced Navigation device should be already configured to output anpp packets #20 and #27.
- Open a new Terminal window and type:
sudo adduser user_name dialout [enter]. This should only need to be done once. - Plug in the USB to RS232 adapter cable that is connected to the Advanced Navigation device.
- In the Terminal window type:
dmesg | grep tty [enter]to confirm the name of the com port (should be something likettyUSB0). - Type:
roscore [enter]to start ROS Master. - Open a new Terminal window and type:
source ~/ros/devel/setup.bash [enter]. - If your com port is named
ttyUSB0and your baud rate is set to 115200 bps, type:rosrun advanced_navigation_driver advanced_navigation_driver [enter]. If your com port or baud rate are different then type:rosrun advanced_navigation_driver advanced_navigation_driver /dev/your_com_port_name your_baud_rate [enter]. - Open a new Terminal window and type:
rosnode list [enter]to list the available nodes. You should see these listed:/an_device_node /rosout - Type:
rostopic list [enter]to list the published topics. You should see these listed:/an_device/FilterStatus /an_device/Imu /an_device/NavSatFix /an_device/SystemStatus /an_device/Twist - Type:
rostopic echo /an_device/Imu[enter]to see theImumessages being published. - Open a new Terminal window and type:
rostopic echo /an_device/NavSatFix[enter]to see theNavSatFixmessages being published. - Open a new Terminal window and type:
rostopic echo /an_device/Twist[enter]to see theTwistmessages being published. - Open a new Terminal window and type:
rostopic echo /an_device/FilterStatus[enter]to see theFilter Statusmessages being published. - Open a new Terminal window and type:
rostopic echo /an_device/SystemStatus[enter]to see theSystem Statusmessages being published. - You need to subscribe to these topics in your code to get access to the data in the messages.
an_device/NavSatFix # GPS: Latitude(纬度) + Longitude(经度) + Altitude(海拔高度)
an_device/Twist # Linear + Angular
an_device/Imu # Orientation + Angular_Velocity + Linear_Acceleration
an_device/SystemStatus # 系统状态
an_device/FilterStatus # 过滤器状态 sensor_msgs / NavSatFix / Header / Stamp / Sec # Packet 20, Field 3, Unix time
sensor_msgs / NavSatFix / Header / Stamp / Nsec # Packet 20, Field 4, Unix time microseconds * 1000
sensor_msgs / NavSatFix / Header / Frame_ID # Fixed to 0
sensor_msgs / NavSatFix / Status / Status # Packet 20, Field 2, Translated from anpp fix type
sensor_msgs / NavSatFix / Status / Service # Fixed to 1 (GPS)
sensor_msgs / NavSatFix / Latitude # Packet 20, Field 5, Converted from radians to degrees
sensor_msgs / NavSatFix / Longitude # Packet 20, Field 6, Converted from radians to degrees
sensor_msgs / NavSatFix / Altitude # Packet 20, Field 7, Metres
sensor_msgs / NavSatFix / Position_Covariance # Packet 20, Fields 21, 22, 23, Variance on the diagonals only, converted from standard deviation metres
sensor_msgs / NavSatFix / Position_Covariance_Type # Fixed to 2 (diagonal known)geometry_msgs / Twist / Linear / X # Packet 20, Field 8, Metres per second
geometry_msgs / Twist / Linear / Y # Packet 20, Field 9, Metres per second
geometry_msgs / Twist / Linear / Z # Packet 20, Field 10, Metres per second
geometry_msgs / Twist / Angular / X # Packet 20, Field 18, Radians per second
geometry_msgs / Twist / Angular / Y # Packet 20, Field 19, Radians per second
geometry_msgs / Twist / Angular / Z # Packet 20, Field 20, Radians per secondsensor_msgs / Imu / Orientation / X # Packet 20, Fields 15, 16, 17, Converted from radians to quaternions
sensor_msgs / Imu / Orientation / Y # Packet 20, Fields 15, 16, 17, Converted from radians to quaternions
sensor_msgs / Imu / Orientation / Z # Packet 20, Fields 15, 16, 17, Converted from radians to quaternions
sensor_msgs / Imu / Orientation / W # Packet 20, Fields 15, 16, 17, Converted from radians to quaternions
sensor_msgs / Imu / Orientation_Covariance # Packet 27, Fields 2, 3, 4, Anpp Packet 27 Field 1 is for the W axis which is not requested
sensor_msgs / Imu / Angular_Velocity / X # Packet 20, Field 18, Radians per second, same as geometry_msgs / Twist / Angular / X
sensor_msgs / Imu / Angular_Velocity / Y # Packet 20, Field 19, Radians per second, same as geometry_msgs / Twist / Angular / Y
sensor_msgs / Imu / Angular_Velocity / Z # Packet 20, Field 20, Radians per second, same as geometry_msgs / Twist / Angular / Z
sensor_msgs / Imu / Linear_Acceleration / X # Packet 20, Field 11, Metres per second per second
sensor_msgs / Imu / Linear_Acceleration / Y # Packet 20, Field 12, Metres per second per second
sensor_msgs / Imu / Linear_Acceleration / Z # Packet 20, Field 13, Metres per second per seconddiagnostic_msgs / Diagnostic_Status / Name # Fixed to `System Status`
diagnostic_msgs / Diagnostic_Status / Level # Packet 20, Field 1, Set to 0 (OK) or 2 (ERROR)
diagnostic_msgs / Diagnostic_Status / Message # Packet 20, Field 1, Variesdiagnostic_msgs / Diagnostic_Status / Name # Fixed to `Filter Status`
diagnostic_msgs / Diagnostic_Status / Level # Packet 20, Field 2, Set to 0 (OK) or 1 (WARN)
diagnostic_msgs / Diagnostic_Status / Message # Packet 20, Field 2, Variessensor_msgs / Imu / Angular_Velocity_Covariance
sensor_msgs / Imu / Linear_Acceleration_Covariance