Matrix calculations wrong in xavier

We have a UKF code which works perfectly in personal laptops. But when try to run it on xavier and jetson tx2 it returns nan values. We investigate the issue and it sounds like the problem is in mathematical calculations on matrices.
the code is inside ukf.cpp file.
The link to code is below:

thanks

Hi,
We don’t have experience to run the sample. Please share more information. What is the purpose of sample? What is the use-case? Does it run on CPU or GPU? …

Please also share your release version:

cat /etc/nv_tegra_release

Hi,

Thank you for the response. It is a ROS (robot operating system) package which runs on Ubuntu 18.04. The code uses UKF (Unscented Kalman Filter) to combine GPS and IMU and estimate an odometry (position) of an autonomous vehicle. We tested the code on different systems and works fine. But in Xavier and Jetson Tx2 the mathematical operations return exponentially very large number and then becomes Nan after 1 or 2 seconds. The normal result of running code in an intel core i7 system and the same code on xavier is shown in below images.

Unfortunately we are not sure whether it is running on CPU or GPU. we use catkin to build and run the code on all systems. How can we check?

The result of command: cat /etc/nv_tegra_release

R32 (release), REVISION: 3.1, GCID: 18186506, BOARD: t186ref, EABI: aarch64, DATE: Tue Dec 10 07:03:07 UTC 2019

Hi,
Could you share steps in detail? So that we can follow it step by step and replicate the issue. And please advise how to identify the matrix is wrong.

2021-11-30-14-46-12.bag (78.0 MB)
To reproduce the issue you might need to install ROS melodic on Ubuntu 18.04 and download the bag file I uploaded here. then do the following steps in terminal:

  1. mkdir ~/catkin_ws/src
  2. cd ~/catkin_ws/src
  3. git clone GitHub - krishnasandeep09/UKF: Unscented Kalman Filter using IMU and GNSS data for vehicle or mobile robot localization
  4. rosdep install --from-paths src --ignore-src -r -y
  5. cd ~/catkin_ws
  6. catkin_make
  7. source devel/setup.bash
  8. roslauch ukf ukf.launch
  9. In another terminal tab run bag file I attached here.
  10. rosbag play <bag_file_name>.
  11. in third terminal you can see the odometry output by below command. in this output the pose value should not increase exponentially nor should be nan:
  12. rostopic echo /odometry/car

Hi,
We will hit this error in running catkin_make:

-- Could NOT find roscpp (missing: roscpp_DIR)
-- Could not find the required component 'roscpp'. The following CMake error ind
icates that you either need to install the package with the same name or change
your environment so that it can be found.
CMake Error at /usr/share/catkin/cmake/catkinConfig.cmake:82 (find_package):
  Could not find a package configuration file provided by "roscpp" with any
  of the following names:

    roscppConfig.cmake
    roscpp-config.cmake

  Add the installation prefix of "roscpp" to CMAKE_PREFIX_PATH or set
  "roscpp_DIR" to a directory containing one of the above files.  If "roscpp"
  provides a separate development package or SDK, be sure it has been
  installed.
Call Stack (most recent call first):
  UKF/ukf/CMakeLists.txt:10 (find_package)


-- Configuring incomplete, errors occurred!
See also "/home/nvidia/catkin_ws/build/CMakeFiles/CMakeOutput.log".
See also "/home/nvidia/catkin_ws/build/CMakeFiles/CMakeError.log".
Invoking "cmake" failed

We are not familiar with ROS. Please help check and advise.

And not sure if it is possible to eliminate installing ROS packages. If the issue is in L4T release, we should be able to reproduce it on default L4T release without ROS installation. Not sure if it is possible to build and run the application on L4T release directly.

Hi,
We rewrote the code in python and solved the issue for now.
Thank you for your assistance.

1 Like

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.