Closed arunavanag591 closed 8 years ago
Is kinect_l_rgb_optical_frame in your TF tree (_rosrun tf viewframes)?
These are my camera frames. I am using Kinect xbox 360.
You're trying to use _kinect_l_rgb_opticalframe. However, this frame does not exist in your TF tree. The frame you want is _camera_rgb_opticalframe. There are two ways to solve this (the 1st is easier):
Thanks, I suspected that, however did not know which file to edit. I should have checked the CMakeLists.txt. But now on doing that, it talks about some base:
terminate called after throwing an instance of 'tf2::ConnectivityException' what(): Could not find a connection between 'base' and 'camera_rgb_optical_frame' because they are not part of the same tree.Tf has two or more unconnected trees.
The code assumes that the robot and the camera are connected in the TF tree. It also assumes that /base is the base frame of the robot. See: https://github.com/atenpas/handle_detector/blob/master/src/localization.cpp#L162-L165
So why does it report that they are not in the same tree. It does not make sense to me. ( i am using openni_launch).
What kind of robot are you using? You probably have to connect them. Looking at the picture that you posted above, there needs to be a connection from _cameralink to some frame on your robot.
I am using a Baxter. My Baxter and my workstation is connected over the same subnet. The kinect is connected to my workstation. I tried getting them together and now I get this:
terminate called after throwing an instance of 'tf2::LookupException'
what(): "camera_rgb_optical_frame" passed to lookupTransform argument source_frame does not exist.
Solved that too. Reading point cloud data from sensor topic: /camera/depth_registered/points Input frame camera_rgb_optical_frame is not equivalent to output frame /camera_rgb_optical_frame ! Exiting ...
Solved
I'm been working through this with the Turtlebot 2 and coming across the same errors, this thread helped me get past some roadblocks.
@BlackMamba591 and/or @atenpas how did you solve that last error ... Input frame camera_rgb_optical_frame is not equivalent to output frame /camera_rgb_optical_frame ! Exiting ...
Much appreciated. Thanks
@mopperHopper What kind of sensor are you using? The code was written for a sensor running on openni_launch with the point cloud being on the /depth_registered/points topic.
@atenpas Using the Xbox Kinect 2 sensor. I'm opening the camera with roslaunch freenect_launch freenect.launch
The graph output by rosrun tf view_frames
is exactly the same as above, so I assumed that the freenect and openni are very similiar. The openni did not work for my Xbox camera, although I didn't give it that valiant of a try after seeing "camera not connected"
So, you're using camera/depth_registered/points for the input point cloud topic?
Yes, at least I think so. In the localization.cpp I have:
const std::string RANGE_SENSOR_FRAME = "/camera_rgb_optical_frame";
const std::string RANGE_SENSOR_TOPIC = "/camera/depth_registered/points";
Do I need to alter any other files?
I think you need to remove the initial slashes (/) from the strings.
Yup, that was the fix! That's not intuitive to me, I would have thought the topic started with /. Thanks a lot.
For this to work, I had to have:
const std::string RANGE_SENSOR_FRAME = "camera_rgb_optical_frame";
const std::string RANGE_SENSOR_TOPIC = "/camera/depth_registered/points";
The topic needs the '/' but the frame does not.
That's correct. The use of '/' in ROS is very confusing.
I am using a Kinect. I am trying to use the sensor and perform the steps as given in 4.2. It throws me the following error.
what(): "kinect_l_rgb_optical_frame" passed to lookupTransform argument source_frame does not exist. [localization-1] process has died [pid 22362, exit code -6, cmd /home/owner/baxter_ws/devel/lib/handle_detector/handle_detector_localization __name:=localization __log:=/home/owner/.ros/log/35ab47c0-191b-11e6-bed3-000af72dcfab/localization-1.log]. log file: /home/owner/.ros/log/35ab47c0-191b-11e6-bed3-000af72dcfab/localization-1*.log all processes on machine have died, roslaunch will exit shutting down processing monitor... ... shutting down processing monitor complete done