Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

IndeterminateLinearSystemError #38

Open
SammySuliman opened this issue Oct 29, 2024 · 1 comment
Open

IndeterminateLinearSystemError #38

SammySuliman opened this issue Oct 29, 2024 · 1 comment

Comments

@SammySuliman
Copy link

SammySuliman commented Oct 29, 2024

Hello,

I am getting the following error as soon as I run the scanmatcher package:

[ERROR] [imu_preintegration-3]: process has died [pid 6088, exit code -6, cmd '/home/singularity1/ros2_ws/install/scanmatcher/lib/scanmatcher/imu_preintegration --ros-args --params-file /home/singularity1/ros2_ws/install/scanmatcher/share/scanmatcher/param/lio.yaml -r /odometry:=/odom'].

This error only occurs when I launch the following node to publish spoof data to the topic /odom. If I don't launch this node I do not get this error:

import rclpy
from rclpy.node import Node
from nav_msgs.msg import Odometry
from std_msgs.msg import Header
from sensor_msgs.msg import Imu
from geometry_msgs.msg import Quaternion, Vector3, Point
from geometry_msgs.msg import Pose, Twist, PoseWithCovariance, TwistWithCovariance
import random

class OdometryPublisher(Node):

    def __init__(self):
        super().__init__('odometry_publisher')
        self.odom_pub = self.create_publisher(Odometry, '/odom', 10)
        timer_period = 0.5  # seconds
        self.timer = self.create_timer(timer_period, self.timer_callback)
        self.x = 0.0
        self.y = 0.0
        self.z = 0.0

    def timer_callback(self):
        odom_msg = Odometry()
        odom_msg.header.frame_id = "velodyne"
        self.z += 0.01
        quaternion = Quaternion()
        linear = Vector3()
        angular = Vector3()
        linear.x = 0.0
        linear.y = 0.0
        linear.z = 0.0
        angular.x = 0.0
        angular.y = 0.0
        angular.z = 0.0
        quaternion.x = 0.0
        quaternion.y = 0.0
        quaternion.z = 0.0
        quaternion.w = 1.0
        pose = Pose()
        pose_w_covar = PoseWithCovariance()
        twist = Twist()
        twist_w_covar = TwistWithCovariance()
        point = Point()
        point.x = self.x
        point.y = self.y
        point.z = self.z
        print('Point', point)
        pose.position = point
        pose.orientation = quaternion
        pose_w_covar.pose = pose
        covar = (0.0,0.0,0.0,0.0,0.0,0.0,
                 0.0,0.0,0.0,0.0,0.0,0.0,
                 0.0,0.0,0.0,0.0,0.0,0.0,
                 0.0,0.0,0.0,0.0,0.0,0.0,
                 0.0,0.0,0.0,0.0,0.0,0.0,
                 0.0,0.0,0.0,0.0,0.0,0.0)
        pose_w_covar.covariance = covar
        odom_msg.pose = pose_w_covar
        twist.linear = linear
        twist.angular = angular
        twist_w_covar.twist = twist
        twist_w_covar.covariance = covar
        odom_msg.twist = twist_w_covar
        self.odom_pub.publish(odom_msg)
        self.get_logger().info('Publishing: "%s"' % odom_msg.header)


def main(args=None):
    rclpy.init(args=args)

    odom_publisher = OdometryPublisher()

    rclpy.spin(odom_publisher)

    # Destroy the node explicitly
    # (optional - otherwise it will be done automatically
    # when the garbage collector destroys the node object)
    odom_publisher.destroy_node()
    rclpy.shutdown()


if __name__ == '__main__':
    main()

I have already read the issues here #34 but I don't understand how this user solved his problem. I also saw this issue here TixiaoShan/LIO-SAM#165 and implemented the fix on lines 308, 381, 442 of imu_preintegration.cpp but it did not work.

I have not altered the yaml file. I am using a BN008X IMU sensor, I am not sure how to know whether my extrinsic params need to be adjusted. However, I am not getting errors when I publish to the topic /imu_raw with another node , only when I publish to /odom, so I do not think this is the issue. Can anyone help me?

@rsasaki0109
Copy link
Owner

rsasaki0109 commented Dec 3, 2024

Sorry, I just noticed this. I haven't really tested this package with spoofed data, but could it be an issue with the timestamps? What you're trying to do seems a bit too specific, so I may not be of much help. If possible, I recommend testing with real LiDAR and IMU data or data from a simulator like Gazebo instead of spoofed data.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants