Two answer both your questions, yes there are solutions but you need to get your hands dirty and build some of then yourself. I'm assuming you're camera is fixed WRT the workspace and views the working volume of the robot.
We have such a system and we place a fiducial marker taped in place on the table. We use ar_track_alvar but there are a few to choose from. We then have measure as accurately as possible where this maker is relative to the robot base, this we setup as a static transform.
Then when you detect the location of the marker in the camera frame you can calculate the extrinsic calibration you want.
Using the process described above our system automatically calibrates itself every time it's started. This avoids having to worry about the camera being knocked when the systems not in use.
Hope this helps.
Originally posted by PeteBlackerThe3rd with karma: 9529 on 2018-07-23
This answer was ACCEPTED on the original site
Post score: 1
Original comments
Comment by artemiialessandrini on 2018-07-25:
Thank you for your responce!
In this way, is it correct to say, that we use a marker's size to calculate an objects size, too?
Additionally, what if the table surface is going to change the anglular orientation? Do we need to recalculate raw, pitch and yaw relatively to the robot,too?
Comment by PeteBlackerThe3rd on 2018-07-25:
Using ar_track_alvar you just have to define the size of the marker in cm. Then it calculates the distance, position and orientation for you. It gives you a full 6 DOF pose of the marker relative to the camera.
Comment by artemiialessandrini on 2018-07-25:
Marking an answer explained.
And going to use markers then, great!
Two additional questions I want to ask:
- "<...> but you need to get your hands dirty" - could I get some references or tags about those other methods?
- Is this method going to work along with standart OpenCV contours detection?
Comment by PeteBlackerThe3rd on 2018-07-25:\
- I was meaning there is a method to solve your problem, it's just not a turn key package you can plug in and configure. Hence having to write your own node using available libraries to get this going.
Comment by PeteBlackerThe3rd on 2018-07-25:
2) I believe the tag detection uses thresholding to a binary image then detects the marker, but I haven't looked at the algorithm in detail. You can add your own node along side to process the camera image using any method you like.