# Accessing previous estimated joint states of a robot

Hi,

I am new to ROS and I am trying to implement a Kalman filter for estimating the joints velocity and acceleration of a robotic manipulator.

The angular position of each joint is published to the topic **/j2n6s300/joint_states**, and the **'estimate_joint_states'** node subscribes to that topic to get the data. Now I want the estimation to be done within **'estimate_joint_states'** node and published to another topic **/j2n6s300/estimated_joint_states**. However, in each iteration of the Kalman filter, the previous estimates of the system (angular position, velocity and acceleration) are required. What is the "ROS way" to access that data? Can the node **estimate_joint_states** subscribe to **/j2n6s300/estimated_joint_states** (the topic in which it is also publishing) and then use its data in the next time step? Or is there a better way to access the previous estimated states?

I know it is possible to write a node which subscribes and publishes at the same time. But is it also possible to implement a node which subscribes to two topics and publishes in to one of them?

I am implementing in python by the way.

Thanks in advance!