RobotnikAutomation/rbcar_sim

Initial Values for the quaternion in rbcar_robot_control.cpp

Closed this issue · 2 comments

Hi,

I was trying to run the robot_control_node from the gazebo launch files to generate odometry data. I was however getting tf errors - the odometry message had a few nan values.
I traced this back to the initialization of the quaternion in rbcar_robot_control.cpp(line 258)- all elements of the quaternion are initialized to 0. This is causing a generation of 'nan' and it then percolates through the code. It probably should be initialized with the real part of the quaternion set to 1.

` // Imu variables
ang_vel_x_ = 0.0; ang_vel_y_ = 0.0; ang_vel_z_ = 0.0;
lin_acc_x_ = 0.0; lin_acc_y_ = 0.0; lin_acc_z_ = 0.0;

orientation_x_ = 0.0; orientation_y_ = 0.0; orientation_z_ = 0.0; orientation_w_ = 0.0;

// Advertise controller services
srv_SetOdometry_ = rbcar_robot_control_node_handle.advertiseService("set_odometry", &RbcarControllerClass::srvCallback_SetOdometry, this);
`

Is there a mistake with the way I run the node? Is there any other way of obtaining odomtery data? I needed odometry data for amcl and other move_base packages ,.
Please let me know!

Thanks!

I think the problem is solved with this commit