Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
mmllee opened this issue Nov 27, 2014 · 14 comments
Open

Comments

@mmllee
Copy link

mmllee commented Nov 27, 2014

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
Copy link
Member

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

@mmllee
Copy link
Author

mmllee commented Nov 27, 2014

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 [email protected]
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
#30 (comment)
.

@mikepurvis
Copy link
Member

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

@mmllee
Copy link
Author

mmllee commented Dec 4, 2014

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 [email protected]
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
#30 (comment)
.

@cedricpradalier
Copy link
Contributor

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" [email protected] 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 [email protected]
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
#30 (comment)
.

@mikepurvis
Copy link
Member

@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
Copy link
Contributor

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 [email protected]
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
#30 (comment)
.

Cedric Pradalier

@alexcordella
Copy link

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

  • in "publishFramesContinuously(self):" put
    ....
    self.publishMsg()
    self.publishCameraInfoMsg()
    .....
    -in "publishCameraInfoMsg(self):" put
    ....
    cimsg = self.axis.cinfo.getCameraInfo() #SUB
    #cimsg.header.stamp = msg.header.stamp #SUB
    cimsg.header.stamp =self. msg.header.stamp #ADD
    cimsg.header.frame_id = self.axis.frame_id
    cimsg.width = self.axis.width
    cimsg.height = self.axis.height
    self.axis.caminfo_pub.publish(cimsg) #ADD
    .....
    Now the camera_info topic is rightly published

Regard,
Alessandro

@awesomebytes
Copy link
Member

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
Copy link
Member

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

@mcorah
Copy link

mcorah commented Jun 4, 2015

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

@alexcordella
Copy link

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
Copy link

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

@filiperosa
Copy link

Also worked for me

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

9 participants