This repository contains the setup for studying localisation and navigation with a vehicle emulator.
It uses the navigation stack and the robot_localization
package. The robot is emulated by a simple vehicle emulator.
A simple emulator with GPS, compass and odometry.
It uses simple kinematics to calculate the vehicle's pose based on the velocity commands received at /cmd_vel
.
/cmd_vel
(geometry_msgs/Twist) Receive velocity commands
/fix
(sensor_msgs/NavSatFix) GPS position with error./imu
(sensor_msgs/Imu) Vehicle orientation only. No angular velocity and acceleration components./twist
(geometry_msgs/TwistWithCovarianceStamped) Linear and angular velocity. The covariance matrix is all zero./odom
(nav_msgs/Odometry) Position, orientation, linear and angular velocity./path
(nav_msgs/Path) Path for debugging
~publish_tf
Whether to publish transform fromodom
frame tobase_link
frame~publish_odom
Wheter to publishnav_msgs/Odometry
messages~publish_twist
Whether to publishgeometry_msgs/TwistWithCovarianceStamped
messages~publish_imu
Whether to publishsensor_msgs/Imu
messages~publish_path
Wheter to publishnav_msgs/Path
messages~publish_fix
Whether to publishsensor_msgs/NavSatFix
messages~gps_err
Emulated GPS error: 0 = no error, 1 = small error, 2 = larger error~odom_left_err
Emulated error of left wheel speed (default is 0.0)~odom_right_err
Emulated error of right wheel speed (default is 0.0)~max_acc_linear
Maximum linear acceleration (default is 10.0)~max_acc_angular
Maximum angular acceleration (default is 10.0)
The odometry error parameters change the effective velocity that is used to calculate the vehicle's position and orientation:
v_left_eff = v_left * (1.0 + param_odom_left_err)
v_right_eff = v_right * (1.0 + param_odom_right_err)
where v_left
and v_right
are the nominal wheel speeds calculated from the /cmd_vel
topic.
Set ROS environment variables.
$ source /opt/ros/melodic/setup.bash
$ source .../ros-study-01/devel/setup.bash
Use rviz
to visualise robot motion and set navigation goals.
$ rosrun rviz rviz --display-config ros_study.rviz
Use rqt_reconfigure
to set parameters of the navigation.
$ rosrun rqt_reconfigure rqt_reconfigure
$ roslaunch ros_study test_loca.launch
In this mode only the vehicle emulator and the localisation nodes are enabled.
The configuration is based on this tutorial.
It can be used to test how the robot_localization
nodes fuse inaccurate sensor data.
$ roslaunch ros_study test_navi.launch
In this mode only the vehicle emulator and the navigation nodes are enabled.
It can be used to test navigation algorithms assuming that the localisation of the vehicle is perfect.
Navigation goals can be set using rviz
.
$ roslaunch ros_study test_navi_loca.launch
In this mode the vehicle emulator and both the navigation and localisation nodes are enables.
This mode emulates the real life scenario when sensor fusion and navigation algorithms have to work together.
Navigation goals can be set using rviz
.