If you have joint state information being published, you have a URDF, and you have the robot_state_publisher
running then you should be able to visualize the pose of the robot in rviz. If all of that is working, to obtain the position of a particular link, all you need to do is create a tf listener and lookup the transform between some inertial frame and a frame on the link that you are interested in. This can easily be done in Python (tutorial here) or C++ (tutorial here).
The robot_state_publisher
subscribes to joint state information and looks at a robot's URDF on the parameter server. With those two pieces of information, it can publish the relevant /tf
data so that the full pose of the robot can be known by any ROS node (including rviz and your own listener).