Running 2 different cameras using usb_cam & Roslaunch
Hello,
I'm using the usb_cam package and launched 2 cameras at the same time.
That is working.
In the meantime I had cloned https://github.com/PRBonn/visual-crop-row-navigation.git
Built the package with:
cd ~/catkinws catkin build visualcroprownavigation source ~/catkin_ws/devel/setup.bash
And then roslaunch:
roslaunch visualcroprow_navigation visualservoing.launch
But always with the following error below.
auto-starting new master process[master]: started with pid [23153] ROSMASTERURI=http://localhost:11311
setting /runid to 96f0a6e4-594d-11ea-b3e7-c0847d44103c process[rosout-1]: started with pid [23164] started core service [/rosout] process[agribotvs-2]: started with pid [23171] [ERROR] [1582800040.638427755]: Visual Servoing core is running... Run parameters loading ... 320 240 ********initialize_neigbourhood******** 320 240 ********initialize_neigbourhood********
Do I need to change/set up something in the usb_cam parameters or on the program parameters
Thanks
Asked by AndreaCec on 2020-02-27 07:00:53 UTC
Answers
Hello Weasfas,
after running roslaunch I should see 2 windows to set HSV values and tune the mask.
But I had never got such windows. Stuck at the ERROR point that you saw in the previous message.
But most probably as you said I should change parameters right? Camera parameters aligned with program ones?
Asked by AndreaCec on 2020-02-27 08:30:33 UTC
Comments
The configuration of camera parameters is useful but not compulsory, furthermore it seems that is not the critical problem here. The real problem is that you have no proper output when, independently of the parameters used, you should be able to receive and see the cameras frames. Take a look at the rqt_graph to be sure you have properly set up the communication between all your nodes, cause it seems the image given by the camera are not being processed in the image callbacks implemented in the code.
Asked by Weasfas on 2020-02-27 09:54:25 UTC
Hello
I got rqt graph here below
https://drive.google.com/file/d/1GuxLGb0ExA5AHigi0v2JL-M0swR9W651/view?usp=sharing
What do you think? Something wrong or needs to be improved?
Thanks
Asked by AndreaCec on 2020-02-27 10:47:46 UTC
Well, there you have the tow raw images but the agribot node is supposed to read the images and looking at that graph I can see that the node has no input.
Asked by Weasfas on 2020-02-27 12:39:05 UTC
Hello but is something related to the developer or related to myself (user)?
How can be solved?
Thanks.
Asked by AndreaCec on 2020-02-27 12:52:33 UTC
Well, from this point it is a problem of communication. With this line of code the developers are subscribing to the images, you need to redirect your output images to the specific topics they are using.
Asked by Weasfas on 2020-02-28 07:36:35 UTC
Fine so that means to modify launch file of usb_cam from:
To:
Or do I need to write a new command in the launch file of usb_cam like:
And copy paste for the back camera...
Thanks.
Asked by AndreaCec on 2020-02-28 08:23:08 UTC
Yes, you need to do a remap to process the incoming image msgs. With:
<remap from="image" to="/camera1/usb_cam1/image_raw"/>
<remap from="image" to="/camera2/usb_cam1/image_raw"/>
You should be able to fix that comunication.
Asked by Weasfas on 2020-02-28 09:40:51 UTC
Below commands are already present in the usb_cam launch file:
Did you mean to be inserted in the agribot_vs launch file?
Where?
Sorry to bother but I am pretty new in ROS. Thanks for your understanding.
Asked by AndreaCec on 2020-02-28 12:42:55 UTC
Oh, sorry I posted the wrong commands:
You usb camera node is producing the image in the topic camera1/image
and camera2/image
since you are using camera1
and camera2
namespaces. You will need to remap from those topic to the topic used by the agribot node.
<remap from="image" to="/front/rgb/image_raw"/>
<remap from="image" to="/back/rgb/image_raw"/>
That will be sufficient I think. Since you are using namespaces, make sure you are appending the proper namespace when launching the files. E.g.: camera1/image
instead of image
.
Sorry for the confusion.
Asked by Weasfas on 2020-02-29 06:19:16 UTC
Comments
Hi @AndreaCec,
Can you be more specific about the problem you are facing? Because it is not very clear what is your problem.
The output you mentioned comes from this function and for me it is just fine.
On the other hand, of course you need to change your parameters since I assume the config file provided in that project was implemented taking into account a certain type of camera. And your sensor and set up can be different.
Asked by Weasfas on 2020-02-27 08:14:28 UTC