ROS Resources: Documentation | Support | Discussion Forum | Index | Service Status | ros @ Robotics Stack Exchange
Ask Your Question
0

multi-threading -> cholesky factorization error, rospy

asked 2014-08-13 10:14:06 -0500

holmes.kirby gravatar image

Hello All,

I have two callbacks within a class that share the same data in python. Is it possible that these callbacks are altering the data at the same time?

I am getting an error while trying to take the cholesky of a covariance matrix.

edit retag flag offensive close merge delete

1 Answer

Sort by ยป oldest newest most voted
1

answered 2014-08-13 10:52:30 -0500

Chrissi gravatar image

That is perfectly possible. Both run in different threads and might therefore write to the same variable while you're reading it. It must not even be both at the same time but if you are reading it outside the callback then the callback might write to it while reading.

Have a look at this to see how thread safety and locks work in python.

edit flag offensive delete link more

Comments

This looks perfect! Hopefully this turns out to be the problem.

thanks

holmes.kirby gravatar image holmes.kirby  ( 2014-08-13 11:23:49 -0500 )edit

Question Tools

1 follower

Stats

Asked: 2014-08-13 10:14:06 -0500

Seen: 558 times

Last updated: Aug 13 '14