I found a deprecated Github repository for the XSens MTi ROS node at https://github.com/xsens/xsens_mti_ros_node that has the definitions for the custom message gnssSample. However, the repository's package name is xsens_msgs while the bag file's package name is custom_msgs. I had to rename the package to get ROS to recognize the bag file's messages. So the following steps were how I resolved the problem.
- Follow the tutorial at https://wiki.ros.org/ROS/Tutorials/CreatingPackage to create a Catkin workspace e.g. /home/yourname/catkin_ws/.
- Open up a Terminal and change the directory to /home/yourname/catkin_ws/src/.
$ cd /home/yourname/catkin_ws/src - Download the XSens MTi ROS Node repository.
$ git clone https://github.com/xsens/xsens_mti_ros_node - Using a text editor, open up the file /home/yourname/catkin_ws/src/xsens_mti_ros_node/src/xsens_msgs/package.xml.
- Change the package name to custom_msgs as shown below.
- Open up the file /home/yourname/catkin_ws/src/xsens_mti_ros_node/src/xsens_msgs/CMakeLists.txt.
- Change the project name to custom_msgs as shown below.
- Now in a Terminal change to the catkin root directory.
$ cd /home/yourname/catkin_ws - Compile the package by entering the command:
$ catkin_make