-
Notifications
You must be signed in to change notification settings - Fork 0
4. End Effector Tracking
Erencan edited this page Jul 12, 2022
·
3 revisions
End effector tracking is achieved by sending the stamped pose data of the tracked object from Unity to ROS and subscribing to that pose in the Cartesian Impedance Example Controller example of the franka_gazebo package. While this is not the most correct way of achieving end effector tracking, it's a simple solution for simulation purposes.
- Navigate to your workspace
- Install franka_ros following the instructions on the official Franka Control Interface (FCI) Github page
- Find the
interactive_marker.py
file located under/PATH_TO_YOUR_WORKSPACE/src/franka_ros/franka_example_controllers/scripts
, create a duplicate of it and rename it tounity_interactive_marker.py
. - In the duplicate file navigate to line 67 and change
pose_pub = rospy.Publisher(
topose_pub = rospy.Subscriber(
so that it subscribes to the topic name /equilibrium_pose rather than publish it. - Find the
panda.launch
file located under/PATH_TO_YOUR_WORKSPACE/src/franka_ros/franka_gazebo/launch
. - Open the file, navigate to line 90 and change
type="interactive_marker.py"
totype="unity_interactive_marker.py"
. - Open the Unity project where the Franka Emika Panda robot is imported along with the target object. (In this case, it's imported with ROS#)
- If you haven't already, configure the ROS Connector as described in Part 2a.
- In three separate terminal tabs, enter the following commands.
roslaunch franka_gazebo panda.launch controller:=cartesian_impedance_example_controller rviz:=true
rosrun rqt_graph rqt_graph
roslaunch rosbridge_server rosbridge_websocket.launch
- Press play on the Unity project and switch to Scene View.
- When you move the target object or change its orientation, you should see the robot follow it or try to match its orientation.
In order for the changes to take effect, you might need to use the
catkin_make
command instead of thecatkin build
command.