This is a python version of computing the end-effector's pose based on base_link.
You can refer to official cpp version:
ur_kinematics package in GitHub Pages
git clone https://github.com/Abbyls/ur5e-fk.git
cd ur5-fk
chmod +x main.py
python main.py