strands-project / scitos_robot

Everything related to the STRANDS robot hardware can go in here
0 stars 10 forks source link

Run chest camera on a different machine #40

Closed Jailander closed 9 years ago

Jailander commented 10 years ago

is there a nice way of running each camera on a different PC? I know that you can add this tag http://wiki.ros.org/roslaunch/XML/machine for choosing on which machine every node has to run, the problem is that the openni has so many launch files and nodes that I am not quite sure which is the best way to do it since we want to have as little data running between machines as possible.

@RaresAmbrus can you help us here

RaresAmbrus commented 10 years ago

Hi, We are thinking about doing this soon, so we can run navigation related nodes on the on-board computer and the rest (metric map, table detection & perception) on another. I think we'll have to start two different openni instances, one on each machine and with its one processing pipeline. The one running on the onboard computer would connect to the chest camera and the other one would connect to the head camera. I have to check how to do this exactly though.

Jailander commented 10 years ago

Hi,

Yes this seems to be very important because we have done some testing and running everything on one computer is not an option.

I think the ideal would be to have a launch file per camera, where you can add the machine name and address as arguments for each camera.

Jailander commented 10 years ago

The main problem I find is that I don't know how some nodes work because I tried launching two instances of the same launch file on each machine changing the arguments with_camera and with_camera2 but they have nodes that are launched simultaneously so it doesn't work (e.g, OpenniWrapperNodelet)

RaresAmbrus commented 10 years ago

I'll have to see how to sort this out, because those nodes need to be launched twice. Maybe I'll try to rename them depending on the camera we're connecting to, something like OpenniWrapperNodelet_Chest_Camera, or something similar.

Jailander commented 10 years ago

I think that should work

RaresAmbrus commented 10 years ago

@Jailander I added a couple of commits that should enable us to run the openni_wrapper on two computers. You need to set the environment variable STRANDS_COMPUTER_NAME on the second computer to avoid node name conflicts.

On the robot you should run:

roslaunch scitos_bringup scitos.launch with_chest_camera:=true with_camera:=false

On the other computer you should run:

export STRANDS_COMPUTER_NAME=some_name
roslaunch openni_wrapper with_camera:=false with_camera2:=true camera:=head_xtion 

This should do the trick.

Jailander commented 10 years ago

Hi @RaresAmbrus, I will test it this afternoon, I guess there is no problem if I swap the cameras (chest camera on another PC and head camera on the main PC) or should I keep it as you have it now??

Jailander commented 10 years ago

Also I guess on the other PC is main.launch it was missing on your instructions:

export STRANDS_COMPUTER_NAME=some_name
roslaunch openni_wrapper main.launch with_camera:=false with_camera2:=true camera:=head_xtion 
RaresAmbrus commented 10 years ago

Hi,

You're right, main.launch was missing.

You can either camera on either PC, it should be ok.

Jailander commented 10 years ago

Thank you, I will get back to you in a bit telling you how it went

cdondrup commented 10 years ago

Just a question: Can't we just use the hostname for the machine name? Of course you have to make sure that you replace everything that is not letters by an underscore but it would make the usage much easier imho.

Jailander commented 10 years ago

Hi,

Btw apart from Christians comment it works!, I also think that it might be smarter to add the machine tag (and create an argument for it) to every node in the launch files so all the launch files can be launched from a single computer, I can do it if you think this is the way to go :) @RaresAmbrus

RaresAmbrus commented 10 years ago

I was actually looking for an environment variable like that, but I couldn't find it - maybe I missed it ? Anyway if we can find something like that, it would definitely be neater, we wouldn't have to define any additional things. @Jailander if you feel like taking a look, I would be very happy :) (I have to tell you though, those openni launch files are quite hairy). Otherwise I'll take care of it, but I'm away for Easter right now, so it'll have to wait till next week.

Jailander commented 10 years ago

I've noticed that they are quite "complex", I'll take a look in any case and get back to you

cdondrup commented 10 years ago

call for compliant hostname: echo $HOSTNAME | sed -e 's/-/_/g' -e 's/ /_/g' -e 's/\(.*\)/\L\1/' may need some other extensions for other special characters. Currently replaces all - and spaces with _ and makes everything lowercase.

cburbridge commented 9 years ago

Done.