├── docs
├── readme.md
├── corenav7.gif
└── framework.png
├── imu_filter
├── README.md
├── launch
│ └── imu_filter.launch
├── package.xml
└── src
│ └── imu_filter.cpp
├── core_navigation
├── script
│ ├── utils
│ │ ├── __init__.py
│ │ ├── data.pyc
│ │ ├── __init__.pyc
│ │ ├── __pycache__
│ │ │ ├── data.cpython-35.pyc
│ │ │ ├── data.cpython-37.pyc
│ │ │ ├── __init__.cpython-35.pyc
│ │ │ └── __init__.cpython-37.pyc
│ │ ├── data.py
│ │ ├── plot.py
│ │ └── utils.py
│ ├── run_cn_frombag.sh
│ └── gp_slip_node.py
├── msg
│ ├── GP_Output.msg
│ └── GP_Input.msg
├── srv
│ └── SetStopping.srv
├── config
│ ├── custom_rosconsole.conf
│ ├── init_params.yaml
│ └── parameters.yaml
├── include
│ └── core_navigation
│ │ ├── InsConst.h
│ │ └── InsUtils.h
├── launch
│ └── corenav.launch
├── CMakeLists.txt
├── package.xml
└── src
│ └── core_nav.cpp
├── gps_core_navigation
├── msg
│ ├── GP_Output.msg
│ └── GP_Input.msg
├── config
│ ├── init_params.yaml
│ └── parameters.yaml
├── include
│ └── gps_core_navigation
│ │ ├── InsConst.h
│ │ └── InsUtils.h
├── CMakeLists.txt
├── src
│ └── gps_core_nav.cpp
├── launch
│ └── gps_corenav.launch
└── package.xml
├── VIO Analysis
├── docs
│ ├── scene1.PNG
│ ├── scenario1.PNG
│ ├── scenario2.PNG
│ ├── scenario3.PNG
│ ├── scenario4.PNG
│ └── scenario5.PNG
└── README.md
├── Kernel Selection
├── docs
│ ├── ours.jpg
│ └── allkernels.jpg
└── README.md
├── hw_interface_plugins
├── hw_interface_plugin_roboteq
│ ├── msg
│ │ ├── ActuatorOut.msg
│ │ └── RoboteqData.msg
│ ├── launch
│ │ ├── Left_Roboteq_Interface.launch
│ │ ├── Right_Roboteq_Interface.launch
│ │ └── launch_params
│ │ │ ├── Left_Roboteq_launch_params.yaml
│ │ │ └── Right_Roboteq_launch_params.yaml
│ ├── roboteq_plugins.xml
│ ├── include
│ │ └── hw_interface_plugin_roboteq
│ │ │ ├── hw_interface_plugin_roboteq_brushed.hpp
│ │ │ └── hw_interface_plugin_roboteq.hpp
│ ├── package.xml
│ └── src
│ │ ├── hw_interface_plugin_roboteq_brushed.cpp
│ │ └── hw_interface_plugin_roboteq_brushless.cpp
└── hw_interface_plugin_adis_imu
│ ├── launch
│ ├── Adis_Imu_Serial_Interface.launch
│ └── launch_params
│ │ └── Adis_Imu_Serial_launch_params.yaml
│ ├── readme.md
│ ├── adis_imu_plugin.xml
│ ├── include
│ └── hw_interface_plugin_adis_imu
│ │ └── hw_interface_plugin_adis_imu_serial.hpp
│ └── package.xml
├── pathfinder_control
├── launch
│ ├── drive_stop.launch
│ ├── control.launch
│ ├── teleop.launch
│ └── control_sim.launch
├── config
│ ├── teleop.yaml
│ ├── twist_mux.yaml
│ └── pathfinder_simple_sim_control.yaml
├── src
│ ├── pathfinder_sim_localization_node.cpp
│ └── drive_straight_with_stop.cpp
└── package.xml
├── init_core_navigation
├── config
│ └── parameters.yaml
├── launch
│ └── init_corenav.launch
├── src
│ └── init_core_nav.cpp
├── CMakeLists.txt
├── package.xml
└── include
│ └── init_core_navigation
│ └── InitCoreNav.h
├── parameter_utils
├── CMakeLists.txt
├── package.xml
└── include
│ └── parameter_utils
│ └── ParameterUtils.h
├── gp_predictor
├── launch
│ └── gp_predictor.launch
├── include
│ └── gp_predictor
│ │ └── gp_predictor.h
└── package.xml
├── hw_interface
├── launch
│ ├── hw_interface.launch
│ ├── hw_interface_debug.launch
│ └── hw_interface_plugins.launch
├── src
│ ├── hw_interface_node.cpp
│ └── base_UDP_interface.cpp
├── package.xml
└── include
│ └── hw_interface
│ ├── bit_utils.h
│ ├── hw_interface.hpp
│ ├── base_UDP_interface.hpp
│ ├── telemetry.hpp
│ └── shared_const_buffer.hpp
├── novatel_launch
├── launch
│ └── novatel.launch
└── package.xml
├── geometry_utils
├── package.xml
├── tests
│ ├── test_so3error.cc
│ └── test_math.cc
├── CMakeLists.txt
├── include
│ └── geometry_utils
│ │ ├── RotationNBase.h
│ │ ├── Vector4.h
│ │ ├── Vector2.h
│ │ ├── Vector3.h
│ │ ├── MatrixNxNBase.h
│ │ ├── GeometryUtilsSerialization.h
│ │ ├── Rotation2.h
│ │ ├── YAMLLoader.h
│ │ ├── Quaternion.h
│ │ ├── Matrix2x2.h
│ │ ├── Transform2.h
│ │ ├── GeometryUtilsMath.h
│ │ ├── Transform3.h
│ │ ├── GeometryUtils.h
│ │ ├── Matrix3x3.h
│ │ └── GeometryUtilsROS.h
└── cmake
│ └── FindEigen3.cmake
├── LICENSE
├── gps_data_log
├── scripts
│ └── gps_log_node.py
└── package.xml
└── README.md
/docs/readme.md:
--------------------------------------------------------------------------------
1 |
2 |
--------------------------------------------------------------------------------
/imu_filter/README.md:
--------------------------------------------------------------------------------
1 | # imu_filter
2 |
--------------------------------------------------------------------------------
/core_navigation/script/utils/__init__.py:
--------------------------------------------------------------------------------
1 |
--------------------------------------------------------------------------------
/core_navigation/msg/GP_Output.msg:
--------------------------------------------------------------------------------
1 | Header header
2 | float64[] mean
3 | float64[] sigma
4 |
--------------------------------------------------------------------------------
/docs/corenav7.gif:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/wvu-navLab/corenav-GP/HEAD/docs/corenav7.gif
--------------------------------------------------------------------------------
/docs/framework.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/wvu-navLab/corenav-GP/HEAD/docs/framework.png
--------------------------------------------------------------------------------
/gps_core_navigation/msg/GP_Output.msg:
--------------------------------------------------------------------------------
1 | Header header
2 | float64[] mean
3 | float64[] sigma
4 |
--------------------------------------------------------------------------------
/core_navigation/msg/GP_Input.msg:
--------------------------------------------------------------------------------
1 | Header header
2 | float64[] time_array
3 | float64[] slip_array
4 |
--------------------------------------------------------------------------------
/gps_core_navigation/msg/GP_Input.msg:
--------------------------------------------------------------------------------
1 | Header header
2 | float64[] time_array
3 | float64[] slip_array
4 |
--------------------------------------------------------------------------------
/VIO Analysis/docs/scene1.PNG:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/wvu-navLab/corenav-GP/HEAD/VIO Analysis/docs/scene1.PNG
--------------------------------------------------------------------------------
/Kernel Selection/docs/ours.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/wvu-navLab/corenav-GP/HEAD/Kernel Selection/docs/ours.jpg
--------------------------------------------------------------------------------
/VIO Analysis/docs/scenario1.PNG:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/wvu-navLab/corenav-GP/HEAD/VIO Analysis/docs/scenario1.PNG
--------------------------------------------------------------------------------
/VIO Analysis/docs/scenario2.PNG:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/wvu-navLab/corenav-GP/HEAD/VIO Analysis/docs/scenario2.PNG
--------------------------------------------------------------------------------
/VIO Analysis/docs/scenario3.PNG:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/wvu-navLab/corenav-GP/HEAD/VIO Analysis/docs/scenario3.PNG
--------------------------------------------------------------------------------
/VIO Analysis/docs/scenario4.PNG:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/wvu-navLab/corenav-GP/HEAD/VIO Analysis/docs/scenario4.PNG
--------------------------------------------------------------------------------
/VIO Analysis/docs/scenario5.PNG:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/wvu-navLab/corenav-GP/HEAD/VIO Analysis/docs/scenario5.PNG
--------------------------------------------------------------------------------
/Kernel Selection/docs/allkernels.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/wvu-navLab/corenav-GP/HEAD/Kernel Selection/docs/allkernels.jpg
--------------------------------------------------------------------------------
/core_navigation/script/utils/data.pyc:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/wvu-navLab/corenav-GP/HEAD/core_navigation/script/utils/data.pyc
--------------------------------------------------------------------------------
/core_navigation/script/utils/__init__.pyc:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/wvu-navLab/corenav-GP/HEAD/core_navigation/script/utils/__init__.pyc
--------------------------------------------------------------------------------
/hw_interface_plugins/hw_interface_plugin_roboteq/msg/ActuatorOut.msg:
--------------------------------------------------------------------------------
1 | int16 fl_speed_cmd
2 | int16 fr_speed_cmd
3 |
4 | int16 bl_speed_cmd
5 | int16 br_speed_cmd
6 |
--------------------------------------------------------------------------------
/core_navigation/script/utils/__pycache__/data.cpython-35.pyc:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/wvu-navLab/corenav-GP/HEAD/core_navigation/script/utils/__pycache__/data.cpython-35.pyc
--------------------------------------------------------------------------------
/core_navigation/script/utils/__pycache__/data.cpython-37.pyc:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/wvu-navLab/corenav-GP/HEAD/core_navigation/script/utils/__pycache__/data.cpython-37.pyc
--------------------------------------------------------------------------------
/core_navigation/script/utils/__pycache__/__init__.cpython-35.pyc:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/wvu-navLab/corenav-GP/HEAD/core_navigation/script/utils/__pycache__/__init__.cpython-35.pyc
--------------------------------------------------------------------------------
/core_navigation/script/utils/__pycache__/__init__.cpython-37.pyc:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/wvu-navLab/corenav-GP/HEAD/core_navigation/script/utils/__pycache__/__init__.cpython-37.pyc
--------------------------------------------------------------------------------
/core_navigation/srv/SetStopping.srv:
--------------------------------------------------------------------------------
1 | bool stopping
2 | ---
3 | float64[225] PvecData
4 | float64[225] QvecData
5 | float64[225] STMvecData
6 | float64[60] HvecData
7 | geometry_msgs/Point PosData
8 |
--------------------------------------------------------------------------------
/pathfinder_control/launch/drive_stop.launch:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
--------------------------------------------------------------------------------
/pathfinder_control/config/teleop.yaml:
--------------------------------------------------------------------------------
1 | teleop_twist_joy:
2 | axis_linear: 1
3 | scale_linear: 0.4
4 | scale_linear_turbo: 1.0
5 | axis_angular: 0
6 | scale_angular: 0.6
7 | scale_angular_turbo: 1.0
8 | enable_button: 0
9 | enable_turbo_button: 2
10 | joy_node:
11 | deadzone: 0.1
12 | autorepeat_rate: 20
13 |
--------------------------------------------------------------------------------
/core_navigation/config/custom_rosconsole.conf:
--------------------------------------------------------------------------------
1 | # config/custom_rosconsole.conf
2 | # You can define your own by e.g. copying this file and setting
3 | # ROSCONSOLE_CONFIG_FILE (in your environment) to point to the new file
4 | #
5 | log4j.logger.ros=INFO
6 | log4j.logger.ros.core_nav=DEBUG
7 | log4j.logger.ros.roscpp.superdebug=WARN
8 |
--------------------------------------------------------------------------------
/pathfinder_control/config/twist_mux.yaml:
--------------------------------------------------------------------------------
1 | topics:
2 | - name : joy
3 | topic : joy_teleop/cmd_vel
4 | timeout : 0.5
5 | priority: 10
6 | - name : external
7 | topic : cmd_vel
8 | timeout : 0.5
9 | priority: 100
10 | locks:
11 | - name : e_stop
12 | topic : e_stop
13 | timeout : 0.0
14 | priority: 255
15 |
--------------------------------------------------------------------------------
/hw_interface_plugins/hw_interface_plugin_roboteq/launch/Left_Roboteq_Interface.launch:
--------------------------------------------------------------------------------
1 |
2 |
3 |
8 |
9 |
10 |
--------------------------------------------------------------------------------
/hw_interface_plugins/hw_interface_plugin_roboteq/launch/Right_Roboteq_Interface.launch:
--------------------------------------------------------------------------------
1 |
2 |
3 |
8 |
9 |
10 |
--------------------------------------------------------------------------------
/init_core_navigation/config/parameters.yaml:
--------------------------------------------------------------------------------
1 | imu:
2 | publish_hz: 250
3 | sensor_pub_rate: 250
4 | topic: /imu/dataAdis
5 |
6 | gps_llh:
7 | topic: /bestpos
8 | gps_ecef:
9 | topic: /bestxyz
10 |
11 | frames:
12 | frame_id_out: map
13 | frame_id_fixed: odom
14 | frame_id_imu: imu_link
15 | frame_id_odo: odom_link
16 |
--------------------------------------------------------------------------------
/parameter_utils/CMakeLists.txt:
--------------------------------------------------------------------------------
1 | cmake_minimum_required(VERSION 2.8.3)
2 | project(parameter_utils)
3 |
4 | find_package(catkin REQUIRED)
5 |
6 | catkin_package(
7 | INCLUDE_DIRS include
8 | )
9 |
10 | install(DIRECTORY include/${PROJECT_NAME}/
11 | DESTINATION ${CATKIN_PACKAGE_INCLUDE_DESTINATION}
12 | FILES_MATCHING PATTERN "*.h"
13 | )
14 |
--------------------------------------------------------------------------------
/gp_predictor/launch/gp_predictor.launch:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
--------------------------------------------------------------------------------
/gps_core_navigation/config/init_params.yaml:
--------------------------------------------------------------------------------
1 | bias_a:
2 | x: 0.049725549309
3 | y: 0.280722422325
4 | z: -9.806383392926
5 | bias_g:
6 | x: -0.000007296495
7 | y: -0.000147732137
8 | z: 0.000591663048
9 | init_ecef:
10 | x: 859207.651300000027
11 | y: -4836200.229899999686
12 | z: 4055498.126499999780
13 | init_llh:
14 | x: 0.693481702495
15 | y: -1.394969205710
16 | z: 373.843300000000
17 |
--------------------------------------------------------------------------------
/core_navigation/config/init_params.yaml:
--------------------------------------------------------------------------------
1 | mean_bias_a:
2 | x: 0.269614133542350
3 | y: -0.262166124574161
4 | z: -9.804005623794065
5 | mean_bias_g:
6 | x: 0.000268715437386711
7 | y: -0.000161452230267971
8 | z: 0.000678693501054130
9 | init_ecef:
10 | x: 859153.015300000
11 | y: -4836303.72660000
12 | z: 4055378.50100000
13 | init_llh:
14 | x: 0.693457963620326
15 | y: -1.39498384275845
16 | z: 334.993517334743
17 | init_att:
18 | x: 0.0
19 | y: 0.0
20 | z: -0.733038286
21 |
--------------------------------------------------------------------------------
/init_core_navigation/launch/init_corenav.launch:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
--------------------------------------------------------------------------------
/hw_interface/launch/hw_interface.launch:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
8 |
9 |
18 |
19 |
--------------------------------------------------------------------------------
/hw_interface_plugins/hw_interface_plugin_adis_imu/launch/Adis_Imu_Serial_Interface.launch:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
10 |
11 |
12 |
13 |
--------------------------------------------------------------------------------
/hw_interface/launch/hw_interface_debug.launch:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
8 |
9 |
19 |
20 |
21 |
--------------------------------------------------------------------------------
/parameter_utils/package.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 | parameter_utils
4 | 0.0.0
5 | The parameter_utils package
6 |
7 | Nathan Michael
8 | Erik Nelson
9 | Erik Nelson
10 |
11 | GPLv2
12 |
13 | catkin
14 | roscpp
15 |
16 |
--------------------------------------------------------------------------------
/imu_filter/launch/imu_filter.launch:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
--------------------------------------------------------------------------------
/novatel_launch/launch/novatel.launch:
--------------------------------------------------------------------------------
1 |
2 |
3 |
6 |
7 | verbose: false
8 | connection_type: serial
9 | device: /dev/serial/by-path/pci-0000:00:14.0-usb-0:3:1.0-port0
10 | frame_id: /gps
11 | publish_novatel_positions: true
12 | polling_period: 0.1
13 | publish_range_messages: true
14 | publish_novatel_xyz_positions: true
15 |
16 |
17 |
18 |
--------------------------------------------------------------------------------
/hw_interface_plugins/hw_interface_plugin_adis_imu/readme.md:
--------------------------------------------------------------------------------
1 | Setup
2 | plugin_names:
3 | {
4 | adis_imu_serial : hw_interface_plugin_adis_imu,
5 | }
6 |
7 | adis_imu_serial:
8 | {
9 | adis_imu : "adis_imu",
10 | }
11 |
12 | adis_imu:
13 | {
14 | deviceName : "/dev/serial/by-path/pci-0000:00:14.0-usb-0:1.1:1.0-port0",
15 | baudrate : 115200,
16 | subscribeToTopic : "/example/subscribe",
17 | publishToTopic : "/imu/data",
18 | publishToTopicAdis : "/imu/dataAdis",
19 | }
20 |
21 |
--------------------------------------------------------------------------------
/init_core_navigation/src/init_core_nav.cpp:
--------------------------------------------------------------------------------
1 |
2 | #include
3 | #include
4 |
5 | int main(int argc, char** argv){
6 | ros::init(argc, argv, "inertial propagation");
7 | ros::NodeHandle n("~");
8 |
9 | InitCoreNav InitCoreNav;
10 | if(!InitCoreNav.Initialize(n)) {
11 | ROS_ERROR("%s: Failed to initialize the nav. filter.",
12 | ros::this_node::getName().c_str());
13 | return EXIT_FAILURE;
14 | }
15 | ros::spin();
16 |
17 | return EXIT_SUCCESS;
18 | }
19 |
--------------------------------------------------------------------------------
/hw_interface_plugins/hw_interface_plugin_roboteq/roboteq_plugins.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 | Roboteq Brushed DC Controller Serial Interface
4 |
5 |
6 |
7 |
8 |
9 | Roboteq Brushless DC Controller Serial Interface
10 |
11 |
12 |
--------------------------------------------------------------------------------
/hw_interface_plugins/hw_interface_plugin_adis_imu/launch/launch_params/Adis_Imu_Serial_launch_params.yaml:
--------------------------------------------------------------------------------
1 | plugin_names:
2 | {
3 | adis_imu_serial : hw_interface_plugin_adis_imu,
4 | }
5 |
6 | adis_imu_serial:
7 | {
8 | adis_imu : "adis_imu",
9 | }
10 |
11 | adis_imu:
12 | {
13 | deviceName : "/dev/serial/by-id/usb-Silicon_Labs_CP2102_USB_to_UART_Bridge_Controller_0001-if00-port0",
14 | baudrate : 115200,
15 | subscribeToTopic : "/example/subscribe",
16 | publishToTopic : "/imu/data",
17 | publishToTopicAdis : "/imu/dataAdis",
18 | }
19 |
20 |
--------------------------------------------------------------------------------
/hw_interface/launch/hw_interface_plugins.launch:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
--------------------------------------------------------------------------------
/core_navigation/script/run_cn_frombag.sh:
--------------------------------------------------------------------------------
1 | !/bin/bash
2 | SESSION=core_nav
3 | ## Start up
4 | tmux -2 new-session -d -s $SESSION
5 |
6 | tmux split-window -v -p 50
7 | tmux split-window -h -p 50
8 | tmux select-pane -t 0
9 | tmux split-window -h -p 50
10 |
11 |
12 | tmux send-keys -t 0 "sleep 3; roslaunch init_core_nav init_corenav.launch " C-m
13 | tmux send-keys -t 1 "sleep 5; roslaunch core_nav corenav.launch" C-m
14 | tmux send-keys -t 2 "sleep 4; cd ~/Desktop; rosbag play 2019-06-28-17-16-48.bag " C-m
15 | tmux send-keys -t 3 "cd ../../..; source devel/setup.bash" C-m
16 | tmux send-keys -t 4 "rqt_multiplot" C-m
17 |
18 | # Attach to session
19 | tmux -2 attach-session -t $SESSION
20 |
--------------------------------------------------------------------------------
/geometry_utils/package.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 | geometry_utils
4 | 0.0.9
5 | geometry_utils
6 |
7 | Nathan Michael
8 | Erik Nelson
9 | Erik Nelson
10 |
11 | GPLv2
12 |
13 | catkin
14 | roscpp
15 | geometry_msgs
16 | tf2
17 |
18 | tf2
19 | roscpp
20 |
21 |
--------------------------------------------------------------------------------
/hw_interface_plugins/hw_interface_plugin_roboteq/launch/launch_params/Left_Roboteq_launch_params.yaml:
--------------------------------------------------------------------------------
1 | plugin_names:
2 | {
3 | brushed : hw_interface_plugin_roboteq
4 | }
5 |
6 | brushed:
7 | {
8 | Left_Roboteq : Left_Roboteq,
9 | }
10 |
11 | Right_Roboteq:
12 | {
13 | deviceName : "/dev/serial/by-path/pci-0000:00:14.0-usb-0:5.3.3:1.0-port1",
14 | baudrate : 115200,
15 | subscribeToTopic : "/control/actuatorout",
16 | publishToTopic : "/roboteq/drivemotorin/left",
17 | controllerType : "Left_Drive",
18 | initializationCmd : "encoder_counter_absolute feedback motor_amps battery_amps",
19 | initCmdCycle : 20,
20 | wheelType : "",
21 | }
22 |
--------------------------------------------------------------------------------
/hw_interface_plugins/hw_interface_plugin_roboteq/launch/launch_params/Right_Roboteq_launch_params.yaml:
--------------------------------------------------------------------------------
1 | plugin_names:
2 | {
3 | brushed : hw_interface_plugin_roboteq
4 | }
5 |
6 | brushed:
7 | {
8 | Right_Roboteq : Right_Roboteq,
9 | }
10 |
11 | Left_Roboteq:
12 | {
13 | deviceName : "/dev/serial/by-path/pci-0000:00:14.0-usb-0:5.3.3:1.0-port0",
14 | baudrate : 115200,
15 | subscribeToTopic : "/control/actuatorout",
16 | publishToTopic : "/roboteq/drivemotorin/right",
17 | controllerType : "Right_Drive",
18 | initializationCmd : "encoder_counter_absolute feedback motor_amps battery_amps",
19 | initCmdCycle : 20,
20 | wheelType : "",
21 | }
22 |
--------------------------------------------------------------------------------
/core_navigation/include/core_navigation/InsConst.h:
--------------------------------------------------------------------------------
1 | /**
2 | * @file InsConst.h
3 | * @brief House values that are repeatedly used
4 | * @author Cagri
5 | */
6 |
7 | #pragma once
8 |
9 | namespace INS {
10 |
11 | const double omega_ie = 7.292115e-5; // rotation of Earth in rad/sec
12 | const double Ro = 6378137.0; //WGS84 Equatorial Radius
13 | const double Rp = 6356752.31425; //WGS84 Polar Radius
14 | const double flat= 1.0/298.257223563; // WGS84 Earth flattening
15 | const double ecc = 0.0818191909425; // WGS84 Eccentricity 0.0818191908426
16 | const double t_const = pow((1.0 - flat),2.0); // constant
17 | const double wheel_radius=0.11; //meters
18 | const double wheelbase=0.555; //meters
19 | const double gravity= 9.80665;
20 | const double PI = 3.14159265358979;
21 |
22 | }
23 |
--------------------------------------------------------------------------------
/gps_core_navigation/include/gps_core_navigation/InsConst.h:
--------------------------------------------------------------------------------
1 | /**
2 | * @file InsConst.h
3 | * @brief House values that are repeatedly used
4 | * @author Cagri
5 | */
6 |
7 | #pragma once
8 |
9 | namespace INS {
10 |
11 | const double omega_ie = 7.292115e-5; // rotation of Earth in rad/sec
12 | const double Ro = 6378137.0; //WGS84 Equatorial Radius
13 | const double Rp = 6356752.31425; //WGS84 Polar Radius
14 | const double flat= 1.0/298.257223563; // WGS84 Earth flattening
15 | const double ecc = 0.0818191909425; // WGS84 Eccentricity 0.0818191908426
16 | const double t_const = pow((1.0 - flat),2.0); // constant
17 | const double wheel_radius=0.11; //meters TODO ~0.12
18 | const double wheelbase=0.5; //meters TODO
19 | const double gravity= 9.80665;
20 | const double PI = 3.14159265358979;
21 |
22 | }
23 |
--------------------------------------------------------------------------------
/core_navigation/launch/corenav.launch:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
10 |
11 |
12 |
13 | position: {x: 0.691949695095547, y: -1.395750757746275, z: 312.2643980319930}
14 | velocity: {vx: 0.0, vy: 0.0, vz: 0.0}
15 | orientation: {qx: 0.0, qy: 0.0, qz: 0.0, qw: 1.0}
16 |
17 |
18 |
19 |
20 |
21 |
22 |
23 |
24 |
--------------------------------------------------------------------------------
/pathfinder_control/config/pathfinder_simple_sim_control.yaml:
--------------------------------------------------------------------------------
1 | pathfinder:
2 | joint_state_controller:
3 | type: joint_state_controller/JointStateController
4 | publish_rate: 50
5 |
6 | front_left_velocity_controller:
7 | type: velocity_controllers/JointVelocityController
8 | joint: base_to_front_left
9 | pid: {p: 1, i: 0, d: 0}
10 | back_left_velocity_controller:
11 | type: velocity_controllers/JointVelocityController
12 | joint: base_to_back_left
13 | pid: {p: 1, i: 0, d: 0}
14 | front_right_velocity_controller:
15 | type: velocity_controllers/JointVelocityController
16 | joint: base_to_front_right
17 | pid: {p: 1, i: 0, d: 0}
18 | back_right_velocity_controller:
19 | type: velocity_controllers/JointVelocityController
20 | joint: base_to_back_right
21 | pid: {p: 1, i: 0, d: 0}
22 |
23 |
--------------------------------------------------------------------------------
/hw_interface_plugins/hw_interface_plugin_adis_imu/adis_imu_plugin.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 | This is a serial interface for the ADIS IMU system
16 |
17 |
18 |
--------------------------------------------------------------------------------
/core_navigation/script/utils/data.py:
--------------------------------------------------------------------------------
1 | import pandas as pd
2 |
3 |
4 | def load_co2(file_path):
5 | co2 = pd.read_csv(file_path, header=None, index_col=None)
6 |
7 | co2_x = co2[1].values
8 | co2_y = co2[0].values
9 |
10 | return co2_x, co2_y
11 |
12 |
13 | def load_erie(file_path):
14 | erie = pd.read_csv(file_path, header=0, names=["date", "level"], index_col=None)
15 |
16 | erie = erie["level"].values
17 | erie = erie[:len(erie)-1]
18 | return erie
19 |
20 | def load_slip(file_path):
21 | slip = pd.read_csv(file_path, header=0, names=["date", "level"], index_col=None)
22 |
23 | slip = slip["level"].values
24 | slip = slip[:len(slip)-1]
25 | return slip
26 |
27 | def load_airline(file_path):
28 | airline = pd.read_csv(file_path, header=None)
29 | airline = airline[1].values
30 |
31 | return airline
32 |
33 |
34 | def load_solar(file_path):
35 | solar = pd.read_csv(file_path, sep=' ', header=None, skiprows=7)
36 | solar = solar[1].values
37 |
38 | return solar
39 |
--------------------------------------------------------------------------------
/init_core_navigation/CMakeLists.txt:
--------------------------------------------------------------------------------
1 | cmake_minimum_required(VERSION 2.8.3)
2 | project(init_core_nav)
3 |
4 | set (CMAKE_CXX_STANDARD 11)
5 |
6 |
7 | find_package(catkin REQUIRED COMPONENTS
8 | roscpp
9 | geometry_utils
10 | parameter_utils
11 | geometry_msgs
12 | sensor_msgs
13 | tf2_ros
14 | tf
15 | roslib
16 | novatel_gps_msgs
17 | )
18 |
19 | catkin_package(
20 | INCLUDE_DIRS include
21 | LIBRARIES ${PROJECT_NAME}
22 | CATKIN_DEPENDS
23 | roscpp
24 | geometry_utils
25 | parameter_utils
26 | geometry_msgs
27 | sensor_msgs
28 | tf2_ros
29 | tf
30 | roslib
31 | novatel_gps_msgs
32 | )
33 |
34 | include_directories(
35 | include
36 | ${catkin_INCLUDE_DIRS}
37 | )
38 |
39 | link_directories(
40 | ${catkin_LIBRARY_DIRS}
41 | )
42 |
43 | add_library(${PROJECT_NAME} src/InitCoreNav.cpp)
44 | target_link_libraries(${PROJECT_NAME}
45 | ${catkin_LIBRARIES}
46 | )
47 |
48 | add_executable(${PROJECT_NAME}_node src/${PROJECT_NAME}.cpp)
49 | target_link_libraries(${PROJECT_NAME}_node
50 | ${PROJECT_NAME}
51 | ${catkin_LIBRARIES}
52 | )
53 |
--------------------------------------------------------------------------------
/hw_interface_plugins/hw_interface_plugin_roboteq/msg/RoboteqData.msg:
--------------------------------------------------------------------------------
1 | # A
2 | int16[] motor_amps
3 |
4 | # AI
5 | int16[] analog_inputs
6 |
7 | # AIC
8 | int16[] analog_inputs_conversion
9 |
10 | # BA
11 | int16[] battery_amps
12 |
13 | # C - returns absolute encoder value; 32bit range +/-2147483648 counts
14 | int32[] encoder_counter_absolute
15 |
16 | # CR - returns amt of counts measured from last query (small numbers usually returned)
17 | int32[] encoder_count_relative
18 |
19 | # BS
20 | int16[] bl_motor_speed_rpm
21 |
22 | # DI
23 | bool[] individual_digital_inputs
24 |
25 | # DR
26 | uint8[] destination_reached
27 |
28 | # FF
29 | uint8 fault_flags
30 | # Where
31 | # f1 = Overheat
32 | # f2 = Overvoltage
33 | # f3 = Undervoltage
34 | # f4 = Short circuit
35 | # f5 = Emergency stop
36 | # f6 = Brushless sensor fault
37 | # f7 = MOSFET failure
38 | # f8 = Default configuration loaded at startup
39 |
40 | # F
41 | int16[] feedback
42 |
43 | # VAR
44 | int32[] user_integer_variable
45 |
46 | # V where
47 | # volts[0] - internal volts
48 | # volts[1] - battery volts
49 | # volts[2] - 5V output
50 | uint16[] volts
51 |
--------------------------------------------------------------------------------
/LICENSE:
--------------------------------------------------------------------------------
1 | MIT License
2 |
3 | Copyright (c) 2020 Cagri Kilic
4 |
5 | Permission is hereby granted, free of charge, to any person obtaining a copy
6 | of this software and associated documentation files (the "Software"), to deal
7 | in the Software without restriction, including without limitation the rights
8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9 | copies of the Software, and to permit persons to whom the Software is
10 | furnished to do so, subject to the following conditions:
11 |
12 | The above copyright notice and this permission notice shall be included in all
13 | copies or substantial portions of the Software.
14 |
15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21 | SOFTWARE.
22 |
--------------------------------------------------------------------------------
/pathfinder_control/src/pathfinder_sim_localization_node.cpp:
--------------------------------------------------------------------------------
1 | #include
2 | #include
3 | #include
4 |
5 | class SimLocalization
6 | {
7 | public:
8 | // Members
9 | ros::NodeHandle nh;
10 | ros::Subscriber odom_sub;
11 | tf::TransformBroadcaster tf_broad;
12 | geometry_msgs::TransformStamped odom_trans;
13 | nav_msgs::Odometry odom;
14 | // Methods
15 | SimLocalization()
16 | {
17 | odom_sub = nh.subscribe("odom",1,&SimLocalization::odomCallback,this);
18 | }
19 | void odomCallback(const nav_msgs::Odometry::ConstPtr& msg)
20 | {
21 | odom_trans.header = msg->header;
22 | odom_trans.child_frame_id = msg->child_frame_id;
23 | odom_trans.transform.translation.x = msg->pose.pose.position.x;
24 | odom_trans.transform.translation.y = msg->pose.pose.position.y;
25 | odom_trans.transform.translation.z = msg->pose.pose.position.z;
26 | odom_trans.transform.rotation = msg->pose.pose.orientation;
27 | tf_broad.sendTransform(odom_trans);
28 | }
29 | };
30 |
31 | int main(int argc, char** argv)
32 | {
33 | ros::init(argc, argv, "pathfinder_sim_localization");
34 | SimLocalization simLocalization;
35 | ros::spin();
36 | return 0;
37 | }
38 |
--------------------------------------------------------------------------------
/gps_core_navigation/CMakeLists.txt:
--------------------------------------------------------------------------------
1 | cmake_minimum_required(VERSION 2.8.3)
2 | project(gps_core_nav)
3 |
4 | set (CMAKE_CXX_STANDARD 11)
5 |
6 |
7 | find_package(catkin REQUIRED COMPONENTS
8 | hw_interface_plugin_roboteq
9 | roscpp
10 | geometry_utils
11 | parameter_utils
12 | geometry_msgs
13 | sensor_msgs
14 | tf2_ros
15 | tf
16 | std_msgs
17 | message_generation
18 | novatel_gps_msgs
19 | )
20 |
21 | #add_message_files(
22 | # FILES
23 | # GP_Input.msg
24 | # GP_Output.msg
25 | #)
26 |
27 | generate_messages(
28 | DEPENDENCIES
29 | std_msgs
30 | )
31 |
32 | catkin_package(
33 | INCLUDE_DIRS include
34 | LIBRARIES ${PROJECT_NAME}
35 | CATKIN_DEPENDS
36 | roscpp
37 | geometry_utils
38 | parameter_utils
39 | geometry_msgs
40 | sensor_msgs
41 | tf2_ros
42 | tf
43 | novatel_gps_msgs
44 | )
45 |
46 | include_directories(
47 | include
48 | ${catkin_INCLUDE_DIRS}
49 | )
50 |
51 | link_directories(
52 | ${catkin_LIBRARY_DIRS}
53 | )
54 |
55 | add_library(${PROJECT_NAME} src/gps_CoreNav.cpp)
56 | target_link_libraries(${PROJECT_NAME}
57 | ${catkin_LIBRARIES}
58 | )
59 |
60 | add_executable(${PROJECT_NAME}_node src/${PROJECT_NAME}.cpp)
61 | target_link_libraries(${PROJECT_NAME}_node
62 | ${PROJECT_NAME}
63 | ${catkin_LIBRARIES}
64 | )
65 |
--------------------------------------------------------------------------------
/core_navigation/include/core_navigation/InsUtils.h:
--------------------------------------------------------------------------------
1 | /**
2 | * @file InsUtils.h
3 | * @brief Tools required to process inertial data
4 | * @author Cagri, Ryan
5 | */
6 |
7 | #pragma once
8 |
9 | #include
10 | #include
11 | #include
12 |
13 | #include
14 | #include
15 | #include
16 | #include
17 | #include
18 | #include
19 |
20 | #include
21 |
22 | #include
23 |
24 | namespace INS {
25 |
26 | typedef Eigen::VectorXd Vector;
27 | typedef Eigen::MatrixXd Matrix;
28 |
29 | typedef Eigen::Matrix Vector3;
30 | typedef Eigen::Matrix Vector6;
31 | typedef Eigen::Matrix Matrix3;
32 |
33 | Vector3 calc_gravity(const double latitude, const double height);
34 |
35 | Matrix3 skew_symm(const Vector3 vec);
36 |
37 | Matrix3 eul_to_dcm(double phi, double theta, double psi);
38 |
39 | Matrix insErrorStateModel_LNF(double R_EPlus, double R_N, Vector3 insLLHPlus, Vector3 insVelPlus, double dt, Matrix3 CbnPlus, double omega_ie,Vector3 omega_n_in,Vector3 f_ib_b,double gravity);
40 |
41 | Matrix calc_Q(double R_N, double R_E, Vector3 insLLHPlus, double dt, Matrix3 CbnPlus,Vector3 f_ib_b);
42 |
43 | }
44 |
--------------------------------------------------------------------------------
/init_core_navigation/package.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 | init_core_nav
4 | 0.1.0
5 | Init Core Navigation
6 |
7 | Cagri Kilic
8 | Cagri Kilic
9 |
10 | GPLv2
11 |
12 | catkin
13 |
14 | roscpp
15 | geometry_utils
16 | parameter_utils
17 | geometry_msgs
18 | sensor_msgs
19 | nav_msgs
20 | tf2_ros
21 | tf
22 | roslib
23 | nav_msgs
24 | novatel_gps_msgs
25 |
26 | roscpp
27 | geometry_utils
28 | parameter_utils
29 | geometry_msgs
30 | sensor_msgs
31 | roslib
32 | tf2_ros
33 | tf
34 | novatel_gps_msgs
35 |
36 |
37 |
--------------------------------------------------------------------------------
/gps_core_navigation/include/gps_core_navigation/InsUtils.h:
--------------------------------------------------------------------------------
1 | /**
2 | * @file InsUtils.h
3 | * @brief Tools required to process inertial data
4 | * @author Cagri, Ryan
5 | */
6 |
7 | #pragma once
8 |
9 | #include
10 | #include
11 | #include
12 |
13 | #include
14 | #include
15 | #include
16 | #include
17 | #include
18 | #include
19 |
20 | #include
21 |
22 | #include
23 |
24 | namespace INS {
25 |
26 | typedef Eigen::VectorXd Vector;
27 | typedef Eigen::MatrixXd Matrix;
28 |
29 | typedef Eigen::Matrix Vector3;
30 | typedef Eigen::Matrix Vector6;
31 | typedef Eigen::Matrix Matrix3;
32 |
33 | Vector3 calc_gravity(const double latitude, const double height);
34 |
35 | Matrix3 skew_symm(const Vector3 vec);
36 |
37 | Matrix3 eul_to_dcm(double phi, double theta, double psi);
38 |
39 | Matrix insErrorStateModel_LNF(double R_EPlus, double R_N, Vector3 insLLHPlus, Vector3 insVelPlus, double dt, Matrix3 CbnPlus, double omega_ie,Vector3 omega_n_in,Vector3 f_ib_b,double gravity);
40 |
41 | Matrix calc_Q(double R_N, double R_E, Vector3 insLLHPlus, double dt, Matrix3 CbnPlus,Vector3 f_ib_b);
42 |
43 | }
44 |
--------------------------------------------------------------------------------
/core_navigation/CMakeLists.txt:
--------------------------------------------------------------------------------
1 | cmake_minimum_required(VERSION 2.8.3)
2 | project(core_nav)
3 |
4 | set (CMAKE_CXX_STANDARD 11)
5 |
6 |
7 | find_package(catkin REQUIRED COMPONENTS
8 | hw_interface_plugin_roboteq
9 | roscpp
10 | geometry_utils
11 | parameter_utils
12 | geometry_msgs
13 | sensor_msgs
14 | tf2_ros
15 | tf
16 | std_msgs
17 | message_generation
18 | )
19 |
20 | add_message_files(
21 | FILES
22 | GP_Input.msg
23 | GP_Output.msg
24 | )
25 |
26 | add_service_files(
27 | FILES
28 | SetStopping.srv
29 | )
30 |
31 |
32 | generate_messages(
33 | DEPENDENCIES
34 | std_msgs
35 | geometry_msgs
36 | )
37 |
38 | catkin_package(
39 | INCLUDE_DIRS include
40 | LIBRARIES ${PROJECT_NAME}
41 | CATKIN_DEPENDS
42 | roscpp
43 | geometry_utils
44 | parameter_utils
45 | geometry_msgs
46 | sensor_msgs
47 | tf2_ros
48 | tf
49 | )
50 |
51 | include_directories(
52 | include
53 | ${catkin_INCLUDE_DIRS}
54 | )
55 |
56 | link_directories(
57 | ${catkin_LIBRARY_DIRS}
58 | )
59 |
60 | add_library(${PROJECT_NAME} src/CoreNav.cpp)
61 | target_link_libraries(${PROJECT_NAME}
62 | ${catkin_LIBRARIES}
63 | )
64 |
65 | add_executable(${PROJECT_NAME}_node src/${PROJECT_NAME}.cpp)
66 | target_link_libraries(${PROJECT_NAME}_node
67 | ${PROJECT_NAME}
68 | ${catkin_LIBRARIES}
69 | )
70 |
--------------------------------------------------------------------------------
/geometry_utils/tests/test_so3error.cc:
--------------------------------------------------------------------------------
1 | #define BOOST_TEST_DYN_LINK
2 | #define BOOST_TEST_MODULE test_equals
3 | #include
4 |
5 | #include
6 | #include
7 |
8 | namespace gu = geometry_utils;
9 |
10 | BOOST_AUTO_TEST_CASE(so3_matrix) {
11 | gu::Rot3 r1(0, 0, 0);
12 | gu::Rot3 r2(0, 0, 0);
13 | gu::Rot3 r3(M_PI/2.0, 0, 0);
14 |
15 | BOOST_CHECK_EQUAL( r1.Error(r2), 0.0 );
16 | BOOST_CHECK_EQUAL( r1.Error(r3), 1.0 );
17 | }
18 |
19 | BOOST_AUTO_TEST_CASE(so3_quat) {
20 | gu::Quat q1 = gu::RToQuat(gu::Rot3(0, 0, 0));
21 | gu::Quat q2 = gu::RToQuat(gu::Rot3(0, 0, 0));
22 | gu::Quat q3 = gu::RToQuat(gu::Rot3(M_PI/2.0, 0, 0));
23 |
24 | gu::Rot3 r1(q1);
25 | gu::Rot3 r2(q2);
26 | gu::Rot3 r3(q3);
27 |
28 | gu::Vec3 v1 = r1.Row(2);
29 | gu::Vec3 v2 = r2.Row(2);
30 | gu::Vec3 v3 = r3.Row(2);
31 |
32 | BOOST_CHECK_EQUAL( acos(v1.Dot(v2)), 0.0 );
33 | BOOST_CHECK_CLOSE( acos(v1.Dot(v3)), M_PI/2.0 , 1e-10);
34 |
35 | BOOST_CHECK_CLOSE( q1.Error(q2).AxisAngle()(0), 0.0, 1e-10);
36 | BOOST_CHECK_CLOSE( q1.Error(q3).AxisAngle()(0), M_PI/2, 1e-10);
37 |
38 | BOOST_CHECK_CLOSE( acos(v1.Dot(v2)), q1.Error(q2).AxisAngle()(0) , 1e-10);
39 | BOOST_CHECK_CLOSE( acos(v1.Dot(v3)), q1.Error(q3).AxisAngle()(0) , 1e-10);
40 | }
41 |
--------------------------------------------------------------------------------
/gps_core_navigation/src/gps_core_nav.cpp:
--------------------------------------------------------------------------------
1 | /*
2 | * Author: Cagri
3 | */
4 |
5 | #include
6 | #include
7 |
8 | int main(int argc, char** argv){
9 | ros::init(argc, argv, "inertial propagation");
10 | ros::NodeHandle n("~");
11 |
12 | gps_CoreNav gps_coreNav;
13 | if(!gps_coreNav.Initialize(n)) {
14 | ROS_ERROR("%s: Failed to initialize the nav. filter.",
15 | ros::this_node::getName().c_str());
16 | return EXIT_FAILURE;
17 | }
18 | while(ros::ok())
19 | {
20 | if(gps_coreNav.propagate_flag)
21 | {
22 | gps_coreNav.Propagate(gps_coreNav.imu,gps_coreNav.odo,gps_coreNav.cmd,gps_coreNav.encoderLeft,gps_coreNav.encoderRight,gps_coreNav.joint, gps_coreNav.gps_ecef, gps_coreNav.gps_llh);
23 | //ROS_INFO("after Propagate\n");
24 | gps_coreNav.propagate_flag =false;
25 | }
26 |
27 | if(gps_coreNav.update_flag)
28 | {
29 | gps_coreNav.Update(gps_coreNav.odo,gps_coreNav.joint);
30 | //ROS_INFO("after Propagate\n");
31 | gps_coreNav.update_flag =false;
32 | }
33 | ros::spinOnce();
34 | }
35 | //ros::spin();
36 |
37 | return EXIT_SUCCESS;
38 | }
39 |
--------------------------------------------------------------------------------
/core_navigation/package.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 | core_nav
4 | 0.1.0
5 | Core Navigation
6 |
7 | Cagri Kilic
8 | Cagri Kilic
9 |
10 | GPLv2
11 |
12 | catkin
13 |
14 | roscpp
15 | geometry_utils
16 | parameter_utils
17 | geometry_msgs
18 | sensor_msgs
19 | nav_msgs
20 | tf2_ros
21 | tf
22 | hw_interface_plugin_roboteq
23 | std_msgs
24 | message_generation
25 | roscpp
26 | geometry_utils
27 | parameter_utils
28 | geometry_msgs
29 | sensor_msgs
30 | nav_msgs
31 | tf2_ros
32 | tf
33 | hw_interface_plugin_roboteq
34 | std_msgs
35 | message_runtime
36 |
37 |
--------------------------------------------------------------------------------
/gps_core_navigation/launch/gps_corenav.launch:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
7 |
8 |
9 |
10 |
14 |
15 |
16 |
26 |
27 |
28 |
29 |
30 |
31 |
32 |
33 |
--------------------------------------------------------------------------------
/geometry_utils/CMakeLists.txt:
--------------------------------------------------------------------------------
1 | cmake_minimum_required(VERSION 2.8.3)
2 | project(geometry_utils)
3 |
4 | set(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} "${CMAKE_CURRENT_LIST_DIR}/cmake")
5 |
6 | find_package(catkin REQUIRED COMPONENTS roscpp)
7 | find_package(Eigen3 REQUIRED)
8 |
9 | catkin_package(
10 | INCLUDE_DIRS
11 | include
12 | ${EIGEN3_INCLUDE_DIR}
13 | LIBRARIES
14 | DEPENDS
15 | Eigen3
16 | )
17 |
18 | include_directories(include ${EIGEN3_INCLUDE_DIR} ${catkin_INCLUDE_DIRS})
19 |
20 | install(DIRECTORY include/${PROJECT_NAME}/
21 | DESTINATION ${CATKIN_PACKAGE_INCLUDE_DESTINATION}
22 | FILES_MATCHING PATTERN "*.h"
23 | )
24 |
25 | install(DIRECTORY cmake/
26 | DESTINATION ${CATKIN_PACKAGE_SHARE_DESTINATION}
27 | FILES_MATCHING PATTERN "*.cmake"
28 | )
29 |
30 | add_executable(test_math tests/test_math.cc)
31 | target_link_libraries(test_math
32 | ${catkin_LIBRARIES}
33 | boost_unit_test_framework
34 | )
35 |
36 | add_executable(test_base tests/test_base.cc)
37 | target_link_libraries(test_base
38 | ${catkin_LIBRARIES}
39 | boost_unit_test_framework
40 | )
41 |
42 | add_executable(test_equals tests/test_equals.cc)
43 | target_link_libraries(test_equals
44 | ${catkin_LIBRARIES}
45 | boost_unit_test_framework
46 | )
47 |
48 | add_executable(test_so3error tests/test_so3error.cc)
49 | target_link_libraries(test_so3error
50 | ${catkin_LIBRARIES}
51 | boost_unit_test_framework
52 | )
53 |
--------------------------------------------------------------------------------
/gps_core_navigation/package.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 | gps_core_nav
4 | 0.1.0
5 | GPS Core Navigation
6 |
7 | Cagri Kilic
8 | Cagri Kilic
9 |
10 | GPLv2
11 |
12 | catkin
13 |
14 | roscpp
15 | geometry_utils
16 | parameter_utils
17 | geometry_msgs
18 | sensor_msgs
19 | nav_msgs
20 | tf2_ros
21 | tf
22 | hw_interface_plugin_roboteq
23 | std_msgs
24 | message_generation
25 | novatel_gps_msgs
26 | roscpp
27 | geometry_utils
28 | parameter_utils
29 | geometry_msgs
30 | sensor_msgs
31 | tf2_ros
32 | tf
33 | hw_interface_plugin_roboteq
34 | std_msgs
35 | message_runtime
36 | novatel_gps_msgs
37 |
38 |
--------------------------------------------------------------------------------
/geometry_utils/include/geometry_utils/RotationNBase.h:
--------------------------------------------------------------------------------
1 | #ifndef GEOMETRY_UTILS_ROTATIONN_H
2 | #define GEOMETRY_UTILS_ROTATIONN_H
3 |
4 | #include
5 | #include
6 | #include "VectorNBase.h"
7 | #include "MatrixNxNBase.h"
8 |
9 | namespace geometry_utils {
10 |
11 | template
12 | struct RotationNBase : MatrixNxNBase {
13 | RotationNBase() : MatrixNxNBase() { this->Eye(); }
14 |
15 | RotationNBase(const RotationNBase& in) : MatrixNxNBase(in.data) {}
16 | RotationNBase(const boost::array& in) : MatrixNxNBase(in) {}
17 | RotationNBase(T (&in)[N * N]) : MatrixNxNBase(in) {}
18 | RotationNBase(const Eigen::Matrix& in) : MatrixNxNBase(in) {}
19 | RotationNBase(const MatrixNxNBase& in) : MatrixNxNBase(in) {}
20 |
21 | virtual inline MatrixNxNBase Inv() const {
22 | return this->Trans();
23 | }
24 | };
25 |
26 | template
27 | inline RotationNBase operator*(const float& lhs,
28 | const RotationNBase& rhs) {
29 | return RotationNBase(rhs * lhs);
30 | }
31 |
32 | template
33 | inline RotationNBase operator*(const double& lhs,
34 | const RotationNBase& rhs) {
35 | return RotationNBase(rhs * lhs);
36 | }
37 |
38 | template
39 | inline RotationNBase Inv(const RotationNBase& m) {
40 | return m.Inv();
41 | }
42 |
43 | }
44 |
45 | #endif
46 |
--------------------------------------------------------------------------------
/geometry_utils/include/geometry_utils/Vector4.h:
--------------------------------------------------------------------------------
1 | #ifndef GEOMETRY_UTILS_VECTOR4_H
2 | #define GEOMETRY_UTILS_VECTOR4_H
3 |
4 | #include "VectorNBase.h"
5 |
6 | namespace geometry_utils {
7 |
8 | template
9 | struct Vector4Base : VectorNBase {
10 | Vector4Base() : VectorNBase() {}
11 | Vector4Base(T val) : VectorNBase(val) {}
12 | Vector4Base(const Vector4Base& in) : VectorNBase(in.data) {}
13 | Vector4Base(const boost::array& in) : VectorNBase(in) {}
14 | Vector4Base(T (&in)[4]) : VectorNBase(in) {}
15 | Vector4Base(const Eigen::Matrix& in) : VectorNBase(in) {}
16 | Vector4Base(const VectorNBase& in) : VectorNBase(in) {}
17 |
18 | Vector4Base(T v1, T v2, T v3, T v4) {
19 | this->data[0] = v1;
20 | this->data[1] = v2;
21 | this->data[2] = v3;
22 | this->data[3] = v4;
23 | }
24 | };
25 |
26 | inline Vector4Base operator*(const float& lhs,
27 | const Vector4Base& rhs) {
28 | return Vector4Base(rhs * lhs);
29 | }
30 |
31 | inline Vector4Base operator*(const double& lhs,
32 | const Vector4Base& rhs) {
33 | return Vector4Base(rhs * lhs);
34 | }
35 |
36 | typedef Vector4Base Vector4f;
37 | typedef Vector4Base Vec4f;
38 |
39 | typedef Vector4Base Vector4d;
40 | typedef Vector4Base Vec4d;
41 |
42 | typedef Vector4Base Vector4;
43 | typedef Vector4Base Vec4;
44 |
45 | }
46 |
47 | #endif
48 |
--------------------------------------------------------------------------------
/geometry_utils/include/geometry_utils/Vector2.h:
--------------------------------------------------------------------------------
1 | #ifndef GEOMETRY_UTILS_VECTOR2_H
2 | #define GEOMETRY_UTILS_VECTOR2_H
3 |
4 | #include "VectorNBase.h"
5 |
6 | namespace geometry_utils {
7 |
8 | template
9 | struct Vector2Base : VectorNBase {
10 | Vector2Base() : VectorNBase() {}
11 | Vector2Base(T val) : VectorNBase(val) {}
12 | Vector2Base(const Vector2Base& in) : VectorNBase(in.data) {}
13 | Vector2Base(const boost::array& in) : VectorNBase(in) {}
14 | Vector2Base(T (&in)[2]) : VectorNBase(in) {}
15 | Vector2Base(const Eigen::Matrix& in) : VectorNBase(in) {}
16 | Vector2Base(const VectorNBase& in) : VectorNBase(in) {}
17 |
18 | Vector2Base(T v1, T v2) {
19 | this->data[0] = v1;
20 | this->data[1] = v2;
21 | }
22 |
23 | T X() const { return this->data[0]; }
24 | T Y() const { return this->data[1]; }
25 | };
26 |
27 | inline Vector2Base operator*(const float& lhs,
28 | const Vector2Base& rhs) {
29 | return Vector2Base(rhs * lhs);
30 | }
31 |
32 | inline Vector2Base operator*(const double& lhs,
33 | const Vector2Base& rhs) {
34 | return Vector2Base(rhs * lhs);
35 | }
36 |
37 | typedef Vector2Base Vector2f;
38 | typedef Vector2Base Vec2f;
39 |
40 | typedef Vector2Base Vector2d;
41 | typedef Vector2Base Vec2d;
42 |
43 | typedef Vector2Base Vector2;
44 | typedef Vector2Base Vec2;
45 |
46 | }
47 |
48 | #endif
49 |
--------------------------------------------------------------------------------
/gps_data_log/scripts/gps_log_node.py:
--------------------------------------------------------------------------------
1 | # /* @file gps_log_node.py
2 | # * @brief Novatel GPS Logger
3 | # * @author Nicholas Ohi
4 | # * @author Cagri Kilic
5 | # */
6 | #!/usr/bin/env python
7 | import rospy
8 | import serial
9 | from datetime import datetime
10 |
11 | def talker():
12 | ser = serial.Serial('/dev/serial/by-path/pci-0000:00:14.0-usb-0:3:1.0-port0', 115200, timeout=0)
13 | time_now = datetime.now()
14 | time_string = time_now.strftime("%Y-%m-%d-%H-%M-%S")
15 | gps_filename = time_string + "_gps.bin"
16 | timestamp_filename = time_string + "_ros_time.txt"
17 | gps_file = open(gps_filename,"w")
18 | timestamp_file = open(timestamp_filename,"w")
19 | rospy.init_node('gps_log_node', anonymous=False)
20 | rate = rospy.Rate(50) # Hz
21 | time_stamp_delta_time = 0.1 # sec
22 | prev_time = rospy.Time.now().to_sec() - time_stamp_delta_time
23 | rospy.loginfo("GPS Logger Running...")
24 | while not rospy.is_shutdown():
25 | data = ser.read(1000)
26 | #print(len(data))
27 | if len(data) > 0:
28 | ros_time = rospy.Time.now().to_sec()
29 | if ros_time - prev_time >= time_stamp_delta_time:
30 | ros_time_string = str(ros_time) + "\n"
31 | #print(ros_time_string)
32 | timestamp_file.write(ros_time_string)
33 | prev_time = ros_time
34 | gps_file.write(data)
35 | rate.sleep()
36 | gps_file.close()
37 | timestamp_file.close()
38 | ser.close()
39 |
40 | if __name__ == '__main__':
41 | try:
42 | talker()
43 | except rospy.ROSInterruptException:
44 | pass
45 |
--------------------------------------------------------------------------------
/hw_interface/src/hw_interface_node.cpp:
--------------------------------------------------------------------------------
1 | #include
2 | #include
3 |
4 | #include
5 |
6 | void mySigintHandler(int sig)
7 | {
8 | // Do some custom action.
9 | // For example, publish a stop message to some other nodes.
10 |
11 | // All the default sigint handler does is call shutdown()
12 | ros::shutdown();
13 | }
14 |
15 | int main(int argc, char **argv)
16 | {
17 | if( ros::console::set_logger_level(ROSCONSOLE_DEFAULT_NAME, ros::console::levels::Info) ) {
18 | ros::console::notifyLoggerLevelsChanged();
19 | }
20 | std::string node_type = "hw_interface";
21 | ROS_INFO("hw_interface Start");
22 | ros::init(argc, argv, node_type, ros::init_options::NoSigintHandler);
23 | ROS_INFO(" - ros::init complete");
24 | if(ros::param::get("node_type", node_type)==false) node_type = "hw_interface";
25 | ros::NodeHandlePtr nh = ros::NodeHandlePtr(new ros::NodeHandle());
26 | ROS_INFO(" - node handle created");
27 |
28 | //override default ros handler
29 | signal(SIGINT, mySigintHandler);
30 |
31 | boost::scoped_ptr hwInterfacePtr(new hw_interface(nh));
32 | ROS_DEBUG("HW_Interface Obj start");
33 |
34 | while(nh->ok())
35 | {
36 | //This is where monitoring of the interfaces can happen.
37 | //Monitoring can also be implemented into the ASIO Thread pool by posting
38 | //the monitoring function into the work queue
39 | ros::spin();
40 | }
41 |
42 | hwInterfacePtr.reset();
43 | ROS_DEBUG("HW_Interface Closing");
44 | return 0;
45 | }
46 |
--------------------------------------------------------------------------------
/Kernel Selection/README.md:
--------------------------------------------------------------------------------
1 | ## Overview
2 |
3 | **Author: Cagri Kilic
4 | Affiliation: [WVU NAVLAB](https://navigationlab.wvu.edu/)
5 | Maintainer: Cagri Kilic, cakilic@mix.wvu.edu**
6 |
7 | Supplementary Kernel Function Selection analyses for the Slip-Based Autonomous ZUPT through Gaussian Process to Improve Planetary Rover Proprioceptive Localization paper.
8 |
9 | The Kernel Functions are used from GPy Gaussian Process (GP) framework https://sheffieldml.github.io/GPy/ and scikit-learn https://scikit-learn.org/ libraries
10 |
11 | The first figure shows the kernel function(s) representation against the same slip data. The aim is heuristically find the best representation of the slip prediction over time. We assumed that slip could happen in two ways. 1) Randomly due to traversing over a rock, entering a pothole, or small local terrain imperfections, 2) continuously due to the mechanical properties of deformable terrains. These two slip behaviors can be represented as spikes for random slips and slowly increasing slip due to continuous slippage.
12 |
13 | ## Kernel Functions
14 |
15 |
16 |
17 |
18 | After careful consideration through mathematical expressions of the kernels, field tests, and simulation analyses, we have selected two kernel functions: Brownian Kernel to model random, high impulsive slippage, and Radial Basis Function Kernel to model continuous similar slip values. Then we have built the composite kernel model to capture both slippage behaviors during traversal as shown in second figure.
19 |
20 | ## Selected Composite Kernel (RBF * Brownian)
21 |
22 |
23 |
24 |
25 |
26 |
--------------------------------------------------------------------------------
/gps_core_navigation/config/parameters.yaml:
--------------------------------------------------------------------------------
1 | init:
2 | position:
3 | # x: 0.69234593
4 | # y: -1.39575202
5 | # z: 312.2643980319930
6 | covx: 1.218469679146834e-14
7 | covy: 1.218469679146834e-14
8 | covz: 0.10000000000000
9 | velocity:
10 | x: 0.0
11 | y: 0.0
12 | z: 0.0
13 | covx: 4.000000000000001e-07
14 | covy: 4.000000000000001e-07
15 | covz: 4.000000000000001e-07
16 |
17 | orientation:
18 | x: 0.0
19 | y: 0.0
20 | z: 4.014
21 | covx: 1.218469679146834e-06
22 | covy: 1.218469679146834e-06
23 | covz: 0.01
24 | # bias:
25 | # accel:
26 | # x: 7.549135895545244e-04
27 | # y: 0.001805886718248
28 | # z: 0.002395586011438
29 | # gyro:
30 | # x: 8.674066138832567e-05
31 | # y: 1.005391303275586e-04
32 | # z: 8.919962404601004e-05
33 | # ecef:
34 | # x: 856206.8996
35 | # y: -4841351.0969
36 | # z: 4049888.7599
37 |
38 | imu:
39 | publish_hz: 250
40 | sensor_pub_rate: 250
41 | topic: /imu/dataAdis
42 | noise:
43 | sig_gyro_inRun : 7.757018897752577e-06
44 | sig_ARW : 2.908882086657216e-05
45 | sig_accel_inRun : 3.139200000000000e-05
46 | sig_VRW : 1.333333333333333e-04
47 |
48 | odo:
49 | topic: /dead_reckoning/odometry
50 | updates:
51 | do_zupt: false
52 | do_zaru: false
53 |
54 | encoderLeft:
55 | topic: /roboteq/drivemotorin/left
56 |
57 | encoderRight:
58 | topic: /roboteq/drivemotorin/right
59 | cmd:
60 | topic: /cmd_vel_out
61 | joint:
62 | topic: /dead_reckoning/joint_states
63 | gps_llh:
64 | topic: /bestpos
65 | gps_ecef:
66 | topic: /bestxyz
67 | # gp:
68 | # topic: /core_nav/core_nav/gp_result
69 |
70 | frames:
71 | frame_id_out: map
72 | frame_id_fixed: odom
73 | frame_id_imu: imu_link
74 | frame_id_odo: odom_link
75 |
76 | wheel:
77 | T_r_: 0.685
78 | s_or_: 0.0
79 | s_delta_or_: 0.0
80 |
--------------------------------------------------------------------------------
/gp_predictor/include/gp_predictor/gp_predictor.h:
--------------------------------------------------------------------------------
1 | #ifndef GP_PREDICTOR_H_
2 | #define GP_PREDICTOR_H_
3 |
4 | #include
5 | #include
6 |
7 |
8 | #include
9 | #include
10 | #include "std_msgs/Int64.h"
11 | #include
12 | #include
13 | #include
14 | #include
15 | #include
16 |
17 |
18 | class GpPredictor
19 | {
20 | public:
21 |
22 | GpPredictor(ros::NodeHandle &);
23 |
24 | typedef Eigen::Matrix Vector3;
25 | typedef Eigen::MatrixXd Matrix;
26 |
27 | void mobility(bool flag);
28 | void mobilityCallback(const std_msgs::Int64::ConstPtr& msg);
29 | void GPCallBack(const core_nav::GP_Output::ConstPtr& gp_data_in_);
30 | bool LoadParameters(const ros::NodeHandle& nh_);
31 | GpPredictor::Vector3 llh_to_enu(const double latitude, const double longitude, const double height);
32 |
33 | core_nav::GP_Input slip_msg;
34 | core_nav::GP_Output gp_data_;
35 |
36 | Eigen::Matrix R_IP;
37 | Eigen::Matrix R_IP_1;
38 | Eigen::Matrix R_IP_2;
39 | Eigen::Matrix K_pred;
40 | Eigen::Matrix H_;
41 | Eigen::Matrix P_pred;
42 | Eigen::Matrix STM_;
43 | Eigen::Matrix Q_;
44 |
45 | GpPredictor::Vector3 savePos, ins_enu_slip, ins_enu_slip3p, ins_enu_slip_3p;
46 | std_msgs::Float64 stop_cmd_msg_;
47 |
48 | bool new_gp_data_arrived_;
49 | bool gp_flag = false;
50 | double gp_arrived_time_;
51 | double xy_errSlip,odomUptCount, startRecording, stopRecording, saveCountOdom;
52 | double init_ecef_x,init_ecef_y,init_ecef_z,init_x, init_y, init_z;
53 | int slip_i=0;
54 | int i=0;
55 |
56 | private:
57 | ros::Subscriber gp_sub_;
58 | ros::Publisher stop_cmd_pub_;
59 | ros::ServiceClient clt_setStopping_;
60 | ros::NodeHandle & nh_;
61 |
62 | };
63 | int main(int argc, char **argv);
64 |
65 | #endif //GP_PREDICTOR_H_
66 |
--------------------------------------------------------------------------------
/imu_filter/package.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 | imu_filter
4 | 0.0.0
5 | The imu_filter package
6 |
7 |
8 |
9 |
10 | cagri
11 |
12 |
13 |
14 |
15 |
16 | TODO
17 |
18 |
19 |
20 |
21 |
22 |
23 |
24 | catkin
25 | geometry_msgs
26 | roscpp
27 | rospy
28 | sensor_msgs
29 | std_msgs
30 | message_filters
31 | geometry_msgs
32 | roscpp
33 | rospy
34 | sensor_msgs
35 | std_msgs
36 | geometry_msgs
37 | roscpp
38 | rospy
39 | sensor_msgs
40 | std_msgs
41 | message_filters
42 |
43 |
44 |
45 |
46 |
47 |
48 |
49 |
50 |
51 |
52 |
53 |
--------------------------------------------------------------------------------
/hw_interface/package.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 | hw_interface
4 | 0.0.1
5 | The hw_interface package
6 |
7 | WVU Interactive Robotics Laboratory
8 | Matthew Gramlich/mpgramlich@mix.wvu.edu
9 | https://github.com/wvu-irl/fast-traverse-pathfinder
10 | https://web.statler.wvu.edu/~irl/
11 |
12 | BSD
13 |
14 |
15 |
16 |
17 |
18 |
19 |
20 |
21 |
22 |
23 |
24 |
25 |
26 |
27 |
28 |
29 |
30 |
31 |
32 |
33 |
34 |
35 |
36 |
37 |
38 | catkin
39 | pluginlib
40 | roscpp
41 | pluginlib
42 | roscpp
43 |
44 |
45 |
46 |
47 |
48 |
49 |
50 |
51 |
--------------------------------------------------------------------------------
/core_navigation/config/parameters.yaml:
--------------------------------------------------------------------------------
1 | init:
2 | orientation:
3 | # x: 0.0
4 | # y: 0.0
5 | # z: 0.0
6 | covx: 1.218469679146834e-06
7 | covy: 1.218469679146834e-06
8 | covz: 1.218469679146834e-06
9 | velocity:
10 | x: 0.0
11 | y: 0.0
12 | z: 0.0
13 | covx: 4.000000000000001e-07
14 | covy: 4.000000000000001e-07
15 | covz: 4.000000000000001e-07
16 | position:
17 | # x: 0.691949695095547
18 | # y: -1.395750757746275
19 | # z: 312.2643980319930
20 | covx: 0.0
21 | covy: 0.0
22 | covz: 0.0
23 | std_bias_a:
24 | x: 0.017333461987301
25 | y: 0.012647240119246
26 | z: 0.020974348023053
27 | std_bias_g:
28 | x: 0.000802891989877233
29 | y: 0.000904288959007464
30 | z: 0.000852026432825422
31 | # bias:
32 | # accel:
33 | # x: 7.549135895545244e-04
34 | # y: 0.001805886718248
35 | # z: 0.002395586011438
36 | # gyro:
37 | # x: 8.674066138832567e-05
38 | # y: 1.005391303275586e-04
39 | # z: 8.919962404601004e-05
40 | # ecef:
41 | # x: 8.565078494000000e+05
42 | # y: -4.842978088500000e+06
43 | # z: 4.047980191900000e+06
44 |
45 | imu:
46 | publish_hz: 50
47 | sensor_pub_rate: 50
48 | topic: /imu_filtered
49 | # topic: /imu/data
50 | noise:
51 | sig_gyro_inRun : 7.757018897752577e-06
52 | sig_ARW : 2.908882086657216e-05
53 | sig_accel_inRun : 3.139200000000000e-05
54 | sig_VRW : 1.333333333333333e-04
55 |
56 | odo:
57 | topic: /dead_reckoning/odometry
58 | updates:
59 | do_zupt: false
60 | do_zaru: false
61 |
62 | encoderLeft:
63 | topic: /roboteq/drivemotorin/left
64 |
65 | encoderRight:
66 | topic: /roboteq/drivemotorin/right
67 | cmd:
68 | topic: /cmd_vel_out
69 | joint:
70 | topic: /dead_reckoning/joint_states
71 | gp:
72 | topic: /core_nav/core_nav/gp_result
73 | stop:
74 | topic: /core_nav/core_nav/stop_cmd
75 |
76 | frames:
77 | frame_id_out: map
78 | frame_id_fixed: odom
79 | frame_id_imu: imu_link
80 | frame_id_odo: odom_link
81 |
82 | wheel:
83 | # T_r_: 0.125
84 | T_r_: 0.685
85 | s_or_: -0.07
86 | # s_or_: 0.0
87 | s_delta_or_: -0.6
88 | # s_delta_or_: 0.0
89 |
--------------------------------------------------------------------------------
/core_navigation/script/utils/plot.py:
--------------------------------------------------------------------------------
1 | import matplotlib.pyplot as plt
2 | import numpy as np
3 |
4 |
5 | def plot_co2(y_true, mean, lb, ub, trainlen, n, r):
6 | plt.plot(range(len(y_true)),y_true,'b',label="Actual")
7 | plt.plot(range(len(y_true)),mean,'r', label="ESN Prediction")
8 | plt.fill_between(range(len(y_true)), lb, ub, facecolor='grey', alpha=0.3)
9 | lo,hi = plt.ylim()
10 | plt.plot([trainlen,trainlen],[lo+np.spacing(1),hi-np.spacing(1)],'k:')
11 | plt.xlabel('Months since Aug 1960')
12 | plt.ylabel('CO2 Concentration (ppmv)')
13 | plt.legend(loc=2)
14 | plt.show()
15 |
16 |
17 | def plot_erie(y_true, mean, lb, ub, trainlen, n, r):
18 | plt.plot(range(len(y_true)),y_true,'b',label="Actual")
19 | plt.plot(range(len(y_true)),mean,'r', label="ESN Prediction")
20 | plt.fill_between(range(len(y_true)), lb, ub, facecolor='grey', alpha=0.3)
21 | lo,hi = plt.ylim()
22 | plt.plot([trainlen,trainlen],[lo+np.spacing(1),hi-np.spacing(1)],'k:')
23 | plt.xlabel('Months since Aug 1922')
24 | plt.ylabel('Water Level')
25 | plt.legend(loc=2)
26 | plt.show()
27 |
28 | def plot_airline(y_true, mean, lb, ub, trainlen, n, r):
29 | plt.plot(range(len(y_true)),y_true,'b',label="Target")
30 | plt.plot(range(len(y_true)),mean,'r', label="ESN n="+str(n)+", r="+str(r))
31 | plt.fill_between(range(len(y_true)), lb, ub, facecolor='grey', alpha=0.3)
32 | lo,hi = plt.ylim()
33 | plt.plot([trainlen,trainlen],[lo+np.spacing(1),hi-np.spacing(1)],'k:')
34 | plt.xlabel('Time (months)')
35 | plt.ylabel('Number of Passengers')
36 | plt.legend(loc=2, fontsize='x-small')
37 | plt.show()
38 |
39 |
40 | def plot_solar(y_true, mean, lb, ub, trainlen, n, r):
41 | plt.plot(range(len(y_true)),y_true,'b',label="Target")
42 | plt.plot(range(len(y_true)),mean,'r', label="ESN n="+str(n)+", r="+str(r))
43 | plt.fill_between(range(len(y_true)), lb, ub, facecolor='grey', alpha=0.3)
44 | lo,hi = plt.ylim()
45 | plt.plot([trainlen,trainlen],[lo+np.spacing(1),hi-np.spacing(1)],'k:')
46 | plt.xlabel('Years since 1629')
47 | plt.ylabel('TSI (w/m^2)')
48 | plt.legend(loc=2, fontsize='x-small')
49 | plt.show()
50 |
--------------------------------------------------------------------------------
/geometry_utils/include/geometry_utils/Vector3.h:
--------------------------------------------------------------------------------
1 | #ifndef GEOMETRY_UTILS_VECTOR3_H
2 | #define GEOMETRY_UTILS_VECTOR3_H
3 |
4 | #include "VectorNBase.h"
5 |
6 | namespace geometry_utils {
7 |
8 | template
9 | struct Vector3Base : VectorNBase {
10 | Vector3Base() : VectorNBase() {}
11 | Vector3Base(T val) : VectorNBase(val) {}
12 | Vector3Base(const Vector3Base& in) : VectorNBase(in.data) {}
13 | Vector3Base(const boost::array& in) : VectorNBase(in) {}
14 | Vector3Base(T (&in)[3]) : VectorNBase(in) {}
15 | Vector3Base(const Eigen::Matrix& in) : VectorNBase(in) {}
16 | Vector3Base(const VectorNBase& in) : VectorNBase(in) {}
17 |
18 | Vector3Base(T v1, T v2, T v3) {
19 | this->data[0] = v1;
20 | this->data[1] = v2;
21 | this->data[2] = v3;
22 | }
23 |
24 | T X() const { return this->data[0]; }
25 | T Y() const { return this->data[1]; }
26 | T Z() const { return this->data[2]; }
27 |
28 | inline Vector3Base Cross(const Vector3Base& v) const {
29 | return Vector3Base(-(*this)(2) * v(1) + (*this)(1) * v(2),
30 | (*this)(2) * v(0) - (*this)(0) * v(2),
31 | -(*this)(1) * v(0) + (*this)(0) * v(1));
32 | }
33 | };
34 |
35 | inline Vector3Base operator*(const float& lhs,
36 | const Vector3Base& rhs) {
37 | return Vector3Base(rhs * lhs);
38 | }
39 |
40 | inline Vector3Base operator*(const double& lhs,
41 | const Vector3Base& rhs) {
42 | return Vector3Base(rhs * lhs);
43 | }
44 |
45 | template
46 | inline VectorNBase Cross(const VectorNBase& v1,
47 | const VectorNBase& v2) {
48 | return Vector3Base(v1).Cross(v2);
49 | }
50 |
51 | typedef Vector3Base Vector3f;
52 | typedef Vector3Base Vec3f;
53 |
54 | typedef Vector3Base Vector3d;
55 | typedef Vector3Base Vec3d;
56 |
57 | typedef Vector3Base Vector3;
58 | typedef Vector3Base Vec3;
59 |
60 | }
61 |
62 | #endif
63 |
--------------------------------------------------------------------------------
/pathfinder_control/launch/control.launch:
--------------------------------------------------------------------------------
1 |
2 |
33 |
34 |
35 |
36 |
37 |
38 |
39 |
40 |
41 |
42 |
43 |
44 |
--------------------------------------------------------------------------------
/geometry_utils/include/geometry_utils/MatrixNxNBase.h:
--------------------------------------------------------------------------------
1 | #ifndef GEOMETRY_UTILS_MATRIXNXN_H
2 | #define GEOMETRY_UTILS_MATRIXNXN_H
3 |
4 | #include
5 | #include "VectorNBase.h"
6 | #include "GeometryUtilsMath.h"
7 | #include "MatrixNxMBase.h"
8 |
9 | namespace geometry_utils {
10 |
11 | template
12 | struct MatrixNxNBase : MatrixNxMBase {
13 | MatrixNxNBase() : MatrixNxMBase() {}
14 | MatrixNxNBase(T val) : MatrixNxMBase(val) {}
15 | MatrixNxNBase(const MatrixNxNBase& in) : MatrixNxMBase(in.data) {}
16 | MatrixNxNBase(const boost::array& in) : MatrixNxMBase(in) {}
17 | MatrixNxNBase(T (&in)[N * N]) : MatrixNxMBase(in) {}
18 | MatrixNxNBase(const Eigen::Matrix& in)
19 | : MatrixNxMBase(in) {}
20 | MatrixNxNBase(const MatrixNxMBase& in)
21 | : MatrixNxMBase(in) {}
22 |
23 | inline void Eye() {
24 | this->data.fill(0);
25 | for (size_t i = 0; i < this->nrows; i++)
26 | this->data[this->nrows * i + i] = 1;
27 | }
28 |
29 | virtual inline T Det() const {
30 | std::cerr << "MatrixNxMBase::det not implemented" << std::endl;
31 | return T();
32 | }
33 |
34 | virtual inline MatrixNxNBase Inv() const {
35 | std::cerr << "MatrixNxMBase::inv not implemented" << std::endl;
36 | return MatrixNxNBase();
37 | }
38 |
39 | static inline MatrixNxNBase Diag(const VectorNBase& in) {
40 | T d[N * N] = {0};
41 | for (size_t i = 0; i < N; i++)
42 | d[N * i + i] = in(i);
43 | return MatrixNxNBase(d);
44 | }
45 | };
46 |
47 | template
48 | inline MatrixNxNBase operator*(const float& lhs,
49 | const MatrixNxNBase& rhs) {
50 | return MatrixNxNBase(rhs * lhs);
51 | }
52 |
53 | template
54 | inline MatrixNxNBase operator*(const double& lhs,
55 | const MatrixNxNBase& rhs) {
56 | return MatrixNxNBase(rhs * lhs);
57 | }
58 |
59 | template
60 | inline MatrixNxNBase Inv(const MatrixNxNBase& m) {
61 | return m.Inv();
62 | }
63 |
64 | }
65 |
66 | #endif
67 |
--------------------------------------------------------------------------------
/pathfinder_control/launch/teleop.launch:
--------------------------------------------------------------------------------
1 |
2 |
33 |
34 |
35 |
36 |
37 |
38 |
39 |
40 |
41 |
42 |
43 |
44 |
45 |
46 |
47 |
48 |
49 |
50 |
51 |
--------------------------------------------------------------------------------
/pathfinder_control/src/drive_straight_with_stop.cpp:
--------------------------------------------------------------------------------
1 | #include
2 | #include
3 | #include
4 |
5 | enum DRIVING_STATE_T {_waiting_for_stop, _stopped} driving_state = _waiting_for_stop;
6 |
7 | const double stop_duration = 5.0; // sec
8 | const double drive_speed = 1.0; // m/s
9 | const double stop_speed = 0.0; // m/s
10 |
11 | double time_to_stop;
12 | bool stop_commanded = false;
13 |
14 | void stopCallback(const std_msgs::Float64::ConstPtr& msg);
15 |
16 | int main(int argc, char** argv)
17 | {
18 | ros::init(argc, argv, "drive_straight_with_stop_node");
19 | ros::NodeHandle nh;
20 | ros::Publisher pub = nh.advertise("cmd_vel", 1);
21 | ros::Subscriber sub = nh.subscribe("/core_nav/core_nav/stop_cmd", 1, stopCallback);
22 | ros::Rate loop_rate(20);
23 | geometry_msgs::Twist cmd_vel_msg;
24 | double stopped_time;
25 |
26 | while(ros::ok())
27 | {
28 | switch(driving_state)
29 | {
30 | case _waiting_for_stop:
31 | if(stop_commanded==true)
32 | {
33 | ROS_INFO("remaining_time = %.3f",time_to_stop - ros::Time::now().toSec());
34 | if(ros::Time::now().toSec() > time_to_stop)
35 | {
36 | stopped_time = ros::Time::now().toSec();
37 | driving_state = _stopped;
38 | }
39 | }
40 | //cmd_vel_msg.linear.x = drive_speed;
41 | break;
42 | case _stopped:
43 | if(ros::Time::now().toSec() - stopped_time > stop_duration)
44 | {
45 | driving_state = _waiting_for_stop;
46 | stop_commanded = false;
47 | }
48 | cmd_vel_msg.linear.x = stop_speed;
49 | pub.publish(cmd_vel_msg); // Moved publisher here
50 | break;
51 | }
52 | // Publisher was here
53 | ros::spinOnce();
54 | loop_rate.sleep();
55 | }
56 |
57 | return 0;
58 | }
59 |
60 | void stopCallback(const std_msgs::Float64::ConstPtr& msg)
61 | {
62 | time_to_stop = ros::Time::now().toSec() + msg->data;
63 | stop_commanded = true;
64 | ROS_INFO("delta time = %.3f",msg->data);
65 | ROS_INFO("time to stop = %.3f",time_to_stop);
66 | }
67 |
--------------------------------------------------------------------------------
/novatel_launch/package.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 | novatel_launch
4 | 0.0.0
5 | The novatel_launch package
6 |
7 | Cagri Kilic
8 | Cagri Kilic/cakilic@mix.wvu.edu
9 |
10 | BSD
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
19 |
20 |
21 |
22 |
23 |
24 |
25 |
26 |
27 |
28 |
29 |
30 |
31 |
32 |
33 |
34 |
35 |
36 |
37 |
38 |
39 |
40 |
41 |
42 |
43 |
44 |
45 | catkin
46 |
47 |
48 |
49 |
50 |
51 |
52 |
53 |
54 |
--------------------------------------------------------------------------------
/gps_data_log/package.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 | gps_data_log
4 | 0.0.0
5 | The gps_data_log package
6 |
7 |
8 |
9 |
10 | nick
11 |
12 |
13 |
14 |
15 |
16 | TODO
17 |
18 |
19 |
20 |
21 |
22 |
23 |
24 |
25 |
26 |
27 |
28 |
29 |
30 |
31 |
32 |
33 |
34 |
35 |
36 |
37 |
38 |
39 |
40 |
41 |
42 | catkin
43 | roscpp
44 | rospy
45 | message_generation
46 | message_runtime
47 | roscpp
48 | rospy
49 | message_generation
50 | message_runtime
51 |
52 |
53 |
54 |
55 |
56 |
57 |
58 |
59 |
--------------------------------------------------------------------------------
/geometry_utils/include/geometry_utils/GeometryUtilsSerialization.h:
--------------------------------------------------------------------------------
1 | /*
2 | geometry_utils: Utility library to provide common geometry types and transformations
3 | Copyright (C) 2013 Nathan Michael
4 | 2016 Erik Nelson
5 |
6 | This program is free software; you can redistribute it and/or
7 | modify it under the terms of the GNU General Public License
8 | as published by the Free Software Foundation; either version 2
9 | of the License, or (at your option) any later version.
10 |
11 | This program is distributed in the hope that it will be useful,
12 | but WITHOUT ANY WARRANTY; without even the implied warranty of
13 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 | GNU General Public License for more details.
15 |
16 | You should have received a copy of the GNU General Public License
17 | along with this program; if not, write to the Free Software
18 | Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
19 | */
20 |
21 | #ifndef GEOMETRY_UTILS_SERIALIZATION_H
22 | #define GEOMETRY_UTILS_SERIALIZATION_H
23 |
24 | #include "GeometryUtils.h"
25 |
26 | #include
27 | #include
28 |
29 | namespace boost {
30 | namespace serialization {
31 |
32 | template
33 | void Serialize(Archive & ar, geometry_utils::Vector2& v,
34 | const unsigned int version) {
35 | ar & v(0);
36 | ar & v(1);
37 | }
38 |
39 | template
40 | void Serialize(Archive & ar, geometry_utils::Vector3& v,
41 | const unsigned int version) {
42 | ar & v(0);
43 | ar & v(1);
44 | ar & v(2);
45 | }
46 |
47 | template
48 | void Serialize(Archive & ar, geometry_utils::Vector4& v,
49 | const unsigned int version) {
50 | ar & v(0);
51 | ar & v(1);
52 | ar & v(2);
53 | ar & v(3);
54 | }
55 |
56 | template
57 | void Serialize(Archive & ar, geometry_utils::Matrix3x3& m,
58 | const unsigned int version) {
59 | for (unsigned int i = 0; i < 3; i++)
60 | for (unsigned int j = 0; j < 3; j++)
61 | ar & m(i, j);
62 | }
63 |
64 | template
65 | void Serialize(Archive & ar, geometry_utils::Transform& t,
66 | const unsigned int version) {
67 | ar & t.translation;
68 | ar & t.rotation;
69 | }
70 |
71 | }
72 | }
73 | #endif
74 |
--------------------------------------------------------------------------------
/VIO Analysis/README.md:
--------------------------------------------------------------------------------
1 | ## Overview
2 |
3 | **Author: Cagri Kilic
4 | Affiliation: [WVU NAVLAB](https://navigationlab.wvu.edu/)
5 | Maintainer: Cagri Kilic, cakilic@mix.wvu.edu**
6 |
7 | Supplementary Visual-Inertial Odometry (VIO) Analyses in low-feature environment for the Slip-Based Autonomous ZUPT through Gaussian Process to Improve Planetary Rover Proprioceptive Localization paper.
8 |
9 | The VIO solution is generated using ROS Wrapper for Intel® RealSense™ Devices https://github.com/IntelRealSense/realsense-ros
10 |
11 | Each figure provides a DGPS solution, filter estimation (corenav-GP solution), 2D Dead Reckoning (only WO and IMU heading). The Google Map representation of the ground truth (DGPS) solution is provided to visualize the low-feature environment (Point Marion, PA, Ashpiles Mars Analog Environment). Solution accuracy values are given for the corenav-GP implementation.
12 |
13 | ### Scenario 1, Execution 1
14 |
15 |
16 |
17 |
18 | *VIO failed after traversing 124m
19 |
20 | ### Scenario 1, Execution 2
21 |
22 |
23 |
24 |
25 |
26 | ### Scenario 1, Execution 3
27 |
28 |
29 |
30 |
31 | ### Scenario 1 Analysis
32 |
33 |
34 |
35 |
36 |
37 | The median values (out of 3 execution) of RMSE for CoreNav-GP are E=1.03m, N=0.49m, U=0.65m
38 |
39 | The median values (out of 3 execution) of RMSE for VIO are E=2.70m, N=12.22*, U=2.12m
40 |
41 | In Execution 1, there is only 124m out of 150m traversed solution for VIO. After 124m, VIO failed and outputs NaN values. For this reason, the star (*) values show the accuracy until 124 m.
42 |
43 |
44 | ### Additional Scenario 1
45 |
46 |
47 |
48 |
49 | The values of RMSE for CoreNav-GP are E=0.66m, N=0.40m, U=2.89m
50 |
51 | The values of RMSE for VIO are E=13.27m, N=56.62m, U=2.12m
52 |
53 | ### Additional Scenario 2
54 |
55 |
56 |
57 |
58 | The values of RMSE for CoreNav-GP are E=1.23m, N=2.51m, U=1.97m
59 |
60 | The values of RMSE for VIO are E=44.04m, N=27.24m, U=0.42m
61 |
62 |
63 |
--------------------------------------------------------------------------------
/hw_interface_plugins/hw_interface_plugin_adis_imu/include/hw_interface_plugin_adis_imu/hw_interface_plugin_adis_imu_serial.hpp:
--------------------------------------------------------------------------------
1 | #ifndef HW_INTERFACE_PLUGIN_ADIS_IMU_HPP__
2 | #define HW_INTERFACE_PLUGIN_ADIS_IMU_HPP__
3 |
4 | //always inlclude these
5 | #include
6 | #include
7 | #include
8 |
9 | //include the header of the base type you want, Serial or UDP
10 | #include
11 | //include ros message types
12 | #include
13 | //TODO
14 | //#include
15 | //#include
16 |
17 | #define CRC32_POLYNOMIAL 0xEDB88320L
18 | #define PI 3.14159265358979
19 | #define RAD2DEG 180.0/PI
20 | #define DEG2RAD PI/180.0
21 | #define IMU_RATE 125.0 // Hz
22 |
23 | namespace hw_interface_plugin_adis_imu {
24 |
25 | class adis_imu_serial : public base_classes::base_serial_interface
26 | {
27 | public:
28 | adis_imu_serial();
29 | ~adis_imu_serial() {}
30 |
31 | protected:
32 |
33 | //these methods are abstract as defined by the base_serial_interface
34 | //they must be defined
35 | bool subPluginInit(ros::NodeHandlePtr nhPtr);
36 | void setInterfaceOptions();
37 | bool interfaceReadHandler(const size_t &length, int arrayStartPos, const boost::system::error_code &ec);
38 | bool verifyChecksum();
39 |
40 | std::size_t adisIMUStreamMatcher(const boost::system::error_code &error, long totalBytesInBuffer);
41 |
42 | long headerLen;
43 | long fullPacketLen;
44 | sensor_msgs::Imu imuMessage;
45 | sensor_msgs::Imu imuMessageAdis;
46 | //TODO
47 | //sensor_msgs::MagneticField magMessage
48 | //sensor_msgs::FluidPressure barMessage
49 | ros::Publisher imuPublisher;
50 | ros::Publisher imuPublisherAdis;
51 | //TODO
52 | //ros::Publisher magPublisher;
53 | //ros::Publisher barPublisher;
54 | double gyroScaleFactor;
55 | double accelScaleFactor;
56 |
57 | private:
58 | unsigned long CRC32Value_(int i);
59 | unsigned long CalculateBlockCRC32_(unsigned long ulCount, unsigned char *ucBuffer ); // Number of bytes in the data block, Data block
60 | };
61 |
62 | }
63 |
64 | PLUGINLIB_EXPORT_CLASS(hw_interface_plugin_adis_imu::adis_imu_serial, base_classes::base_interface)
65 |
66 |
67 |
68 | #endif //HW_INTERFACE_PLUGIN_ADIS_IMU_HPP__
69 |
70 |
--------------------------------------------------------------------------------
/pathfinder_control/launch/control_sim.launch:
--------------------------------------------------------------------------------
1 |
2 |
33 |
34 |
35 |
36 |
37 |
38 |
39 |
40 |
41 |
42 |
43 |
44 |
45 |
46 |
47 |
--------------------------------------------------------------------------------
/hw_interface_plugins/hw_interface_plugin_roboteq/include/hw_interface_plugin_roboteq/hw_interface_plugin_roboteq_brushed.hpp:
--------------------------------------------------------------------------------
1 | /*********************************************************************
2 | * Software License Agreement (BSD License)
3 | *
4 | * Copyright (c) 2019, WVU Interactive Robotics Laboratory
5 | * https://web.statler.wvu.edu/~irl/
6 | * All rights reserved.
7 | *
8 | * Redistribution and use in source and binary forms, with or without
9 | * modification, are permitted provided that the following conditions
10 | * are met:
11 | *
12 | * * Redistributions of source code must retain the above copyright
13 | * notice, this list of conditions and the following disclaimer.
14 | * * Redistributions in binary form must reproduce the above
15 | * copyright notice, this list of conditions and the following
16 | * disclaimer in the documentation and/or other materials provided
17 | * with the distribution.
18 | * * Neither the name of the WVU Interactive Robotics Laboratory nor
19 | * the names of its contributors may be used to endorse or promote products
20 | * derived from this software without specific prior written permission.
21 | *
22 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
23 | * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
24 | * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
25 | * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
26 | * COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
27 | * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
28 | * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
29 | * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
30 | * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
31 | * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN
32 | * ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
33 | * POSSIBILITY OF SUCH DAMAGE.
34 | *********************************************************************/
35 |
36 | #ifndef HW_INTERFACE_PLUGIN_ROBOTEQ_BRUSHED_HPP__
37 | #define HW_INTERFACE_PLUGIN_ROBOTEQ_BRUSHED_HPP__
38 |
39 | #include
40 |
41 | namespace hw_interface_plugin_roboteq
42 | {
43 | class brushed : public hw_interface_plugin_roboteq::roboteq_serial
44 | {
45 | public:
46 | brushed();
47 |
48 | protected:
49 | bool implStart();
50 | bool implStop();
51 | bool implDataHandler();
52 |
53 | };
54 | }
55 |
56 | PLUGINLIB_EXPORT_CLASS(hw_interface_plugin_roboteq::brushed, base_classes::base_interface)
57 |
58 | #endif //HW_INTERFACE_PLUGIN_ROBOTEQ_BRUSHED_HPP__
59 |
--------------------------------------------------------------------------------
/hw_interface_plugins/hw_interface_plugin_roboteq/package.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 | hw_interface_plugin_roboteq
4 | 0.0.0
5 | The hw_interface_plugin_roboteq package
6 |
7 | WVU Interactive Robotics Laboratory
8 | Jennifer Nguyen/jqnguyen@mix.wvu.edu
9 | Matthew Gramlich/mpgramlich@mix.wvu.edu
10 | Nicholas Ohi/nohi@mix.wvu.edu
11 | https://github.com/wvu-irl/fast-traverse-pathfinder
12 | https://web.statler.wvu.edu/~irl/
13 |
14 |
15 |
16 |
17 |
18 | TODO
19 |
20 |
21 |
22 |
23 |
24 |
25 |
26 |
27 |
28 |
29 |
30 |
31 |
32 |
33 |
34 |
35 |
36 |
37 |
38 |
39 |
40 |
41 |
42 |
43 |
44 | catkin
45 | hw_interface
46 | pluginlib
47 | roscpp
48 | message_generation
49 | hw_interface
50 | pluginlib
51 | roscpp
52 | message_generation
53 |
54 |
55 |
56 |
57 |
58 |
59 |
60 |
61 |
62 |
--------------------------------------------------------------------------------
/geometry_utils/include/geometry_utils/Rotation2.h:
--------------------------------------------------------------------------------
1 | #ifndef GEOMETRY_UTILS_ROTATION2_H
2 | #define GEOMETRY_UTILS_ROTATION2_H
3 |
4 | #include
5 | #include "GeometryUtilsMath.h"
6 | #include "RotationNBase.h"
7 | #include "Matrix2x2.h"
8 |
9 | namespace geometry_utils {
10 |
11 | template
12 | struct Rotation2Base : RotationNBase {
13 | Rotation2Base() : RotationNBase() {}
14 | Rotation2Base(const Rotation2Base& in) : RotationNBase(in.data) {}
15 | Rotation2Base(const boost::array& in) : RotationNBase(in) {}
16 | Rotation2Base(T (&in)[2 * 2]) : RotationNBase(in) {}
17 | Rotation2Base(const Eigen::Matrix& in) : RotationNBase(in) {}
18 | Rotation2Base(const Eigen::Rotation2D& in)
19 | : RotationNBase(in.toRotationMatrix()) {}
20 | Rotation2Base(const RotationNBase& in) : RotationNBase(in) {}
21 | Rotation2Base(const Matrix2x2Base& in) : RotationNBase(in) {}
22 | Rotation2Base(const MatrixNxMBase& in) : RotationNBase(in) {}
23 |
24 | Rotation2Base(T val) { FromAngle(val); }
25 |
26 | Rotation2Base(T R11, T R12, T R21, T R22) {
27 | this->data[0] = R11;
28 | this->data[1] = R12;
29 | this->data[2] = R21;
30 | this->data[3] = R22;
31 | }
32 |
33 | virtual inline bool Equals(const Rotation2Base& that,
34 | const T ptol = 1e-8) const {
35 | return Error(that) < ptol;
36 | }
37 |
38 | inline T Error(const Rotation2Base& r) const {
39 | return math::sin(Angle() - r.Angle());
40 | }
41 |
42 | inline T Angle() const {
43 | return math::atan2(this->data[2], this->data[0]);
44 | }
45 |
46 | inline void FromAngle(T val) {
47 | this->data[0] = math::cos(val);
48 | this->data[1] = -math::sin(val);
49 | this->data[2] = math::sin(val);
50 | this->data[3] = math::cos(val);
51 | }
52 |
53 | inline Eigen::Rotation2D Eigen() {
54 | return Eigen::Rotation2D(Angle());
55 | }
56 | };
57 |
58 | inline Rotation2Base operator*(const float& lhs,
59 | const Rotation2Base& rhs) {
60 | return Rotation2Base(rhs.Scale(lhs));
61 | }
62 |
63 | inline Rotation2Base operator*(const double& lhs,
64 | const Rotation2Base& rhs) {
65 | return Rotation2Base(rhs.Scale(lhs));
66 | }
67 |
68 | template
69 | inline Eigen::Rotation2D Eigen(const Rotation2Base& in) {
70 | return in.Eigen();
71 | }
72 |
73 | typedef Rotation2Base Rotation2f;
74 | typedef Rotation2Base Rot2f;
75 |
76 | typedef Rotation2Base Rotation2d;
77 | typedef Rotation2Base Rot2d;
78 |
79 | typedef Rotation2Base Rotation2;
80 | typedef Rotation2Base Rot2;
81 |
82 | }
83 |
84 | #endif
85 |
--------------------------------------------------------------------------------
/hw_interface_plugins/hw_interface_plugin_adis_imu/package.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 | hw_interface_plugin_adis_imu
4 | 0.0.1
5 | ADIS IMU HW_Interface Package
6 |
7 |
8 |
9 |
10 | ros
11 |
12 |
13 |
14 |
15 |
16 | BSD
17 |
18 |
19 |
20 |
21 |
22 |
23 |
24 |
25 |
26 |
27 |
28 | Cagri Kilic
29 | Nick Ohi
30 | Matt Gramlich
31 |
32 |
33 |
34 |
35 |
36 |
37 |
38 |
39 |
40 |
41 |
42 |
43 | catkin
44 |
45 | hw_interface
46 | pluginlib
47 | roscpp
48 | sensor_msgs
49 |
50 | hw_interface
51 | pluginlib
52 | roscpp
53 | sensor_msgs
54 |
55 |
56 |
57 |
58 |
59 |
60 |
61 |
62 |
63 |
64 |
65 |
66 |
67 |
--------------------------------------------------------------------------------
/core_navigation/script/gp_slip_node.py:
--------------------------------------------------------------------------------
1 | #!/usr/bin/env python
2 | import sys
3 | import GPy
4 | import rospy
5 | import numpy as np
6 | #from matplotlib import pyplot as plt
7 | #from utils.data import *
8 | from core_nav.msg import GP_Input
9 | from core_nav.msg import GP_Output
10 | #from IPython.display import display
11 |
12 | pub = rospy.Publisher('/core_nav/core_nav/gp_result', GP_Output, queue_size=1)
13 |
14 |
15 |
16 | def callback(data):
17 | # Do GP stuff here *********
18 | rospy.loginfo("GP Input Arrived")
19 | X = data.time_array
20 | #X = [1,2,3,4,5]
21 | X = np.array(X).reshape(len(X), 1)
22 |
23 | Y = data.slip_array
24 | #Y = [0.1,0.05,-0.009,0.1,-0.002]
25 | Y = np.array(Y).reshape(len(Y), 1)
26 |
27 | per = 0.9
28 |
29 | x_train, y_train = X[:int(per * len(X))], Y[:int(per * len(Y))]
30 | x_test, y_test = X[int(per * len(X)):], Y[int(per * len(Y)):]
31 | kernel = (GPy.kern.RBF(1)) * GPy.kern.Brownian(1)
32 | # # GPy.kern.Matern32(1), GPy.kern.Matern52(1), GPy.kern.Brownian(1),
33 | # # GPy.kern.Bias(1), GPy.kern.Linear(1), GPy.kern.PeriodicExponential(1),
34 | # # GPy.kern.White(1)]
35 | m = GPy.models.GPRegression(x_train, y_train, kernel)
36 | m.optimize(messages=False)
37 |
38 |
39 | # display(m)
40 | means = [] # predictions
41 | variances = [] # uncertainty
42 | #means2= [] #predictions
43 | #variances2 = [] #uncertainty
44 | # X_=np.arange(X.min(),X.max()+50, 0.1)
45 | X_ = np.arange(X.min(), X.max() + 600, 1)
46 |
47 | for x in X_:
48 | mean, covar = m.predict(np.array([[x]]))
49 | variances.append(covar[0])
50 | means.append(mean[0])
51 | #means2.append(mean[0])
52 | #variances2.append(covar[0])
53 |
54 | # **************************
55 |
56 | # Write output arrays into msg_out.mean and msg_out.sigma
57 | msg_out = GP_Output()
58 | # TODO: need to populate the header (i.e. msg_out.header)
59 | msg_out.mean = np.array(means[int(len(X)):]) # [0,1,3,4] # for example
60 | # [6,7,8,9] # for example
61 | msg_out.sigma = 2 * np.sqrt(np.array(variances[int(len(X)):]))
62 | rospy.loginfo("Publishing GP Results")
63 | pub.publish(msg_out)
64 |
65 | #ses = 2 * np.sqrt(np.array(variances2))
66 | #means = np.array(means2)
67 | #var1 = np.array(means + ses).reshape(1, len(means + ses))
68 | #var2 = np.array(means - ses).reshape(1, len(means - ses))
69 | # m.plot()
70 | # plt.xlim(X.min(), X_.max())
71 | # plt.plot(X, Y, c='r', linewidth=0.2)
72 | # # confidence intervals #C0C0C0
73 | # plt.fill_between(X_, var2[0, :], var1[0, :], alpha=0.3, color='k')
74 | # plt.plot(x_test, y_test, 'xk')
75 | # plt.ylim(-1.5, 1.5)
76 | # plt.show()
77 |
78 |
79 | def gaussian_process():
80 | rospy.init_node('gp_slip_node')
81 | rospy.Subscriber('/core_nav/core_nav/gp_input', GP_Input, callback)
82 | #rospy.loginfo_once("GP Mode Has Started")
83 | rospy.spin()
84 |
85 |
86 | if __name__ == '__main__':
87 | gaussian_process()
88 |
--------------------------------------------------------------------------------
/geometry_utils/tests/test_math.cc:
--------------------------------------------------------------------------------
1 | #define BOOST_TEST_DYN_LINK
2 | #define BOOST_TEST_MODULE test_math
3 | #include
4 |
5 | #include
6 | #include
7 |
8 | namespace gu = geometry_utils;
9 | namespace gm = gu::math;
10 |
11 | BOOST_AUTO_TEST_CASE(math) {
12 | srand(time(NULL));
13 | float rf = static_cast(rand())/static_cast(RAND_MAX);
14 | double rd = static_cast(rand())/static_cast