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

compatibility to aravis 0.6 tested on ubuntu 16.04 + kinetic #8

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions CMakeModules/FindAravis.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,10 @@ INCLUDE(FindPackageHandleStandardArgs)

FIND_PATH(ARAVIS_INCLUDE_PATH arv.h
"$ENV{ARAVIS_INCLUDE_PATH}"
/usr/local/include/aravis-0.4
/usr/local/include/aravis-0.6
)

FIND_LIBRARY(ARAVIS_LIBRARY aravis-0.4
FIND_LIBRARY(ARAVIS_LIBRARY aravis-0.6
"$ENV{ARAVIS_LIBRARY}"
/usr/local/lib
)
Expand Down
14 changes: 8 additions & 6 deletions src/camnode.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -515,17 +515,19 @@ static void NewBuffer_callback (ArvStream *pStream, ApplicationData *pApplicatio
pBuffer = arv_stream_try_pop_buffer (pStream);
if (pBuffer != NULL)
{
if (pBuffer->status == ARV_BUFFER_STATUS_SUCCESS)
if (arv_buffer_get_status(pBuffer) == ARV_BUFFER_STATUS_SUCCESS)
{
sensor_msgs::Image msg;

pApplicationdata->nBuffers++;
std::vector<uint8_t> this_data(pBuffer->size);
memcpy(&this_data[0], pBuffer->data, pBuffer->size);
size_t size;
const void *ptr = arv_buffer_get_data(pBuffer, &size);
std::vector<uint8_t> this_data(size);
memcpy(&this_data[0], ptr, size);


// Camera/ROS Timestamp coordination.
cn = (uint64_t)pBuffer->timestamp_ns; // Camera now
cn = (uint64_t)arv_buffer_get_timestamp(pBuffer); // Camera now
rn = ros::Time::now().toNSec(); // ROS now

if (iFrame < 10)
Expand Down Expand Up @@ -558,7 +560,7 @@ static void NewBuffer_callback (ArvStream *pStream, ApplicationData *pApplicatio

// Construct the image message.
msg.header.stamp.fromNSec(tn);
msg.header.seq = pBuffer->frame_id;
msg.header.seq = arv_buffer_get_frame_id(pBuffer);
msg.header.frame_id = global.config.frame_id;
msg.width = global.widthRoi;
msg.height = global.heightRoi;
Expand All @@ -578,7 +580,7 @@ static void NewBuffer_callback (ArvStream *pStream, ApplicationData *pApplicatio

}
else
ROS_WARN ("Frame error: %s", szBufferStatusFromInt[pBuffer->status]);
ROS_WARN ("Frame error: %s", szBufferStatusFromInt[arv_buffer_get_status(pBuffer)]);

arv_stream_push_buffer (pStream, pBuffer);
iFrame++;
Expand Down