moveit_setup_assistant how to choose chain, joint and link for planning group
BACKGROUND
In moveit_setup_assistant tutorial, in planning group section, it tells that click joint button to choose joints for right_arm. I did this and followed all the procedure as the tutorial tells.
However, when trying to roslaunch the demo.launch from pr2_moveit_config I generated, I found that the interactive marker was missing in rviz.
I searched for solution in ros answer and found that they said it might be either end effector or parent link of end effector undefined. I checked my config setup for pr2, however, actually all were set as the tutorial asks.
Then, I turned to the book, ros-by-example V2, CH11, which introduces moveit, where configuring planning group for pi robot, it edit chain for right_arm instead of editing joint.
So I modified chain section and deleted joint section for right_arm group for pr2.
It turned out that interactive marker appeared finally, and worked well.
QUESTION
What are meant by chain, joint and link for planning group in moveit setup, respectively?
When might one choose chain or joint for arm?
When should one choose link or/and joint for end effector?
In book, Master ROS for Robotics Programming Here is the setting for planning group, where it sets chain for arm and both joint and link for gripper( instead, the above 2 tutorial only set link for gripper).
In conclusion, 3 tutorials set planning group differently, why?