ros-drivers / axis_camera

Contains basic Python drivers for accessing an Axis camera's MJPG stream. Also provides control for PTZ cameras.
BSD 3-Clause "New" or "Revised" License
52 stars 75 forks source link

camera_info not published (self is missing when getting a member value) #30

Open mmllee opened 9 years ago

mmllee commented 9 years ago

bug in axis.py line 128: cimsg.header.stamp = msg.header.stamp // (exception is thrown here!) should read cimsg.header.stamp = self.msg.header.stamp

mikepurvis commented 9 years ago

This is true, but that function is not actually called from anywhere, I don't think. How are you triggering the problem?

mmllee commented 9 years ago

Hi, true :) I completely forgot that I actually added an explicit call to it, after publishMsg() is invoked after line 75 I added: self.publishCameraInfoMsg() Without it the bug would never manifest itself

Publishing camera_info is useful if you want to get a rectified image e.g. using image_proc package (it needs /axis/image_raw and /axis/camera_info topics)

To get an uncompressed image at /axis/image_raw I run ROS_NAMESPACE=axis rosrun image_transport republish compressed in:=image_raw raw out:=image_raw

Best, Marcin

On Thu, Nov 27, 2014 at 1:12 PM, Mike Purvis notifications@github.com wrote:

This is true, but that function is not actually called from anywhere, I don't think. How are you triggering the problem?

— Reply to this email directly or view it on GitHub https://github.com/clearpathrobotics/axis_camera/issues/30#issuecomment-64782957 .

mikepurvis commented 9 years ago

Would you consider submitting a PR which more comprehensively enables camera calibration, and includes as part of it a bugfix for this issue?

mmllee commented 9 years ago

Sure, I'll try to do it during the weekend, actually I derived a bit more general script, which could work with any mjpeg stream in particular with http vlc stream (which can in turn transcode any input stream into http mjpeg). That may not be the most effective way, but effectively you can even stream from rtsp servers, video files etc.

Best, Marcin

On Thu, Nov 27, 2014 at 2:58 PM, Mike Purvis notifications@github.com wrote:

Would you consider submitting a PR which more comprehensively enables camera calibration, and includes as part of it a bugfix for this issue?

— Reply to this email directly or view it on GitHub https://github.com/clearpathrobotics/axis_camera/issues/30#issuecomment-64793250 .

cedricpradalier commented 9 years ago

Hi all,

As a side note, there is a working patch for gstreamer and mjpeg stream (it must be in this discussion thread somewhere).

I've found it to be the less CPU intensive on small cpus (e.g. atom)

HTH

Cedric, mobile, big-thumbed and concise On Dec 4, 2014 5:40 PM, "mmllee" notifications@github.com wrote:

Sure, I'll try to do it during the weekend, actually I derived a bit more general script, which could work with any mjpeg stream in particular with http vlc stream (which can in turn transcode any input stream into http mjpeg). That may not be the most effective way, but effectively you can even stream from rtsp servers, video files etc.

Best, Marcin

On Thu, Nov 27, 2014 at 2:58 PM, Mike Purvis notifications@github.com wrote:

Would you consider submitting a PR which more comprehensively enables camera calibration, and includes as part of it a bugfix for this issue?

— Reply to this email directly or view it on GitHub < https://github.com/clearpathrobotics/axis_camera/issues/30#issuecomment-64793250>

.

— Reply to this email directly or view it on GitHub https://github.com/clearpathrobotics/axis_camera/issues/30#issuecomment-65661126 .

mikepurvis commented 9 years ago

@cedricpradalier When I was trying to spruce this driver up in July, I added a launchfile which uses gscam instead of the built-in driver: https://github.com/clearpathrobotics/axis_camera/blob/master/launch/axis_gscam.launch

Unfortunately, I had enough problems with it that I wasn't content to recommend that approach as the default. I don't recall now what all went wrong, but it was fiddly to get working and would be difficult to deploy as a deb without cooperation from some upstream maintainers.

cedricpradalier commented 9 years ago

This is very true. The really good http package is not in the default repositories (not sure why) and the gscam package does not publish jpeg (compressed) object by default. That being said, it manages connection in a smoother more reliable way and uses way less CPU than the python driver (or the default http client of gstreamer).

I'd recommend that only for people with a very tight processing budget (such as the kingfisher, in my case). In our case, it has recorded close to 2 million images so far, so I find it quite reliable after my finetuning.

Regards.

On Thu, Dec 4, 2014 at 8:24 PM, Mike Purvis notifications@github.com wrote:

@cedricpradalier https://github.com/cedricpradalier When I was trying to spruce this driver up in July, I added a launchfile which uses gscam instead of the built-in driver: https://github.com/clearpathrobotics/axis_camera/blob/master/launch/axis_gscam.launch

Unfortunately, I had enough problems with it that I wasn't content to recommend that approach as the default. I don't recall now what all went wrong, but it was fiddly to get working and would be difficult to deploy as a deb without cooperation from some upstream maintainers.

— Reply to this email directly or view it on GitHub https://github.com/clearpathrobotics/axis_camera/issues/30#issuecomment-65687386 .

Cedric Pradalier

alexcordella commented 9 years ago

Hi all, I solved this issue. You have put these lines into the axis.py:

Regard, Alessandro

awesomebytes commented 9 years ago

The issue is not very related to its tittle anymore. It's an interesting discussion tho. If anyone makes a PR to fix the camera_info stuff I would be glad to give it a try and merge.

jack-oquin commented 9 years ago

@alexcordella: can you render your previous message in some more-readable form?

mcorah commented 9 years ago

I submitted a pull request to fix this issue. #38 implements what was originally being discussed and what @alexcordella was describing.

alexcordella commented 9 years ago

Open axis.py: 1- Function "publishFramesContinuously(self):" put .... self.publishMsg() self.publishCameraInfoMsg() ..... 2- Function "publishCameraInfoMsg(self):" put .... cimsg = self.axis.cinfo.getCameraInfo()

cimsg.header.stamp = msg.header.stamp

cimsg.header.stamp =self.msg.header.stamp cimsg.header.frame_id = self.axis.frame_id cimsg.width = self.axis.width cimsg.height = self.axis.height self.axis.caminfo_pub.publish(cimsg) ....

Now the camera_info topic is rightly published. Let me know if now is readable.

ibaranov-cp commented 9 years ago

I agree with this fix, just worked for me. Makes callibration much more feasible to use now.

filiperosa commented 8 years ago

Also worked for me