5. Transform the camera co ordinate axis to the Baxter's co ordinate axis - mclumd/baxter_pcl GitHub Wiki

$ rosrun tf static_transform_publisher <x> <y> <z> <qx> <qy> <qz> <qw> <parent frame> /camera_link 50

  <x> – x distance of 3d camera from the <parent frame>
  <y> -  y distance of 3d camera from the <parent frame>
  <z>  - z distance of 3d camera from the <parent frame>
  <qx> - rotation of 3d camera around x – axis from the <parent frame>
  <qy> - rotation of 3d camera around y – axis from the <parent frame>
  <qz> - rotation of 3d camera around z -axis from the <parent frame>

How to find x,y,z?

Terminal window 1: Run openni2

$ cd ros_ws

$ ./baxter.sh

$ roslaunch openni2_launch openni2.launch

Terminal window 2: Key in some default values to specify the location of camera w.r.t Baxter

$ cd ros_ws

$ ./baxter.sh

$ rosrun tf static_transform_publisher 1 0 0 .1 0 0 0 /torso /camera_link 50

Terminal window 3: Run rviz visualizer

$ cd ros_ws

$ rosrun rviz rviz

A GUI window appears as shown in the figure below

Rviz GUI Window

  1. From the displays panel in the top left, in the global options change the fixed frame to “torso”
  2. click on add button and select the “RobotModel” option from the selectable,
  3. similarly click on “TF” from the selectable
  4. Expand the TF from the display panel and deselect “show names” and “show Axes” options.

Transformation Image

The yellow line in the figure above represents the distance of the camera from Baxter's torso, let us adjust the x,y,z of the camera to make it look like how we had on the physical Baxter.

Note:

   x coordinate with respect to Baxter is y coordinate in real world

   y coordinate with respect to Baxter is x coordinate in our perception

   1 unit in Baxter is equal to 1 cm in real world

Terminal Window 2: Re-execute the command with adjusted x,y,z values

$ rosrun tf static_transform_publisher 0.2 0 0.2 .1 0 0 0 /torso /camera_link 50

You should adjust the values in such a way, that the camera in the simulator should match the camera mounted on the real physical Baxter as shown below.

Simulated Baxter and Physical Baxter

How to find qx,qy,qz?

  1. click on add button from the displays panel and select the Pointcloud2 option from the selectable
  2. Expand the Pointcloud2 selectable and select the topic “/camera/depth_registered/points”.

When you completed these two steps, you should be looking at a point cloud from the 3d camera, like in the figure below

point cloud in simulator

adjust the qx, qy, qz in such a way that the table is at zero degrees from the Baxter's torso.

Terminal Window 2 : Re-execute the command with adjusted qx,qy,qz values

$ rosrun tf static_transform_publisher 0.2 0 0.2 0 0.580 0 0 /torso /camera_link 50

table at zero degrees to baxter

FIRST PHASE : FILTERING

⚠️ **GitHub.com Fallback** ⚠️