Need help with an assignment ? FK and IK demonstration with moveit!

Hello sir , i am actually try to do FK and IK visualisation for robot whose urdf , i have .
The question is like this:
“Let displacement of Joins(j1,j2,j3,j4) and Tool
offset(x,y,z,rx,ry,rz) be as inputs, and get outputs
of Position and Orientation (x,y,z,rx,ry,rz) about
Tool Center Point(TCP) and each joint.”

This is the process , I am planning to follow.
->generate a custom IK plugin for given urdf using IK fast and add it to move it.
->Customize the moveit using moveit setup assistant and the given urdf
Forward kinematics:
planning use these command

    group_variable_values[5] = -1.5
    group.set_joint_value_target(group_variable_values)
    #set joint values
    group.plan() to #perform planning
    #
   print group.get_current_pose()#To give the end-effector position.

Inverse Kinematics

   #set end effector pose
    pose_target.orientation.w = 1.0
    pose_target.position.x = 0.96
    pose_target.position.y = 0
    pose_target.position.z = 1.18
    group.set_pose_target(pose_target)
    
    group.plan() to #perform planning
    #
    print group.get_current_joint_values()#To give the joint values

I would like to know what is tool offset , kinematics calculation usually involves relation between joints and end-effector pose right ?

The Tool offset is an offset thatwe have to take into account AFTER the inverse Kinematics is made, which compensates for each tool we have. Normally the IK is done until the ToolBase, and depending on the gripper we have to compensate for that. This is done this way becuase grippers are not normally added into moveit chain.