Skip to content
This repository has been archived by the owner on Feb 21, 2021. It is now read-only.

Commit

Permalink
Merge pull request #720 from fqez/issue_639
Browse files Browse the repository at this point in the history
[issue #639] Made cameraview bilingual
Fix #659 #639
  • Loading branch information
fqez authored Mar 13, 2017
2 parents c858365 + de8124f commit 73cd006
Show file tree
Hide file tree
Showing 4 changed files with 24 additions and 42 deletions.
10 changes: 7 additions & 3 deletions src/tools/cameraview/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -14,10 +14,14 @@ include_directories(
${ZLIB_INCLUDE_DIRS}
${resourcelocator_INCLUDE_DIRS}
${easyiceconfig_INCLUDE_DIRS}
${jderobottypes_INCLUDE_DIRS}
${jderobotcomm_INCLUDE_DIRS}
${roscpp_INCLUDE_DIRS}
)
link_directories(
${resourcelocator_LIBRARY_DIRS}
${easyiceconfig_LIBRARY_DIRS}
${jderobotcomm_LIBRARY_DIRS}
)

add_executable (cameraview ${SOURCE_FILES})
Expand All @@ -29,11 +33,11 @@ TARGET_LINK_LIBRARIES(cameraview
${gtkmm_LIBRARIES}
${libglademm_LIBRARIES}
colorspacesmm
JderobotInterfaces
parallelIce
${easyiceconfig_LIBRARIES}
${ZeroCIce_LIBRARIES}
${ZLIB_LIBRARIES}
${CMAKE_THREAD_LIBS_INIT}
${CMAKE_THREAD_LIBS_INIT}
${resourcelocator_LIBRARIES}
${catkin_LIBRARIES}
${jderobotcomm_LIBRARIES}
)
6 changes: 5 additions & 1 deletion src/tools/cameraview/cameraview.cfg
Original file line number Diff line number Diff line change
@@ -1,2 +1,6 @@
Cameraview.Camera.Proxy=cameraA:default -h 0.0.0.0 -p 9999
# 0 -> Deactivate, 1 -> Ice , 2 -> ROS
Cameraview.Camera.Server=1
Cameraview.Camera.Proxy=cameraA:tcp -h localhost -p 9999
Cameraview.Camera.Format=RGB8
Cameraview.Camera.Topic=/camera/rgb/image_raw
Cameraview.Camera.Name=cameraA
49 changes: 12 additions & 37 deletions src/tools/cameraview/cameraview.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -22,58 +22,33 @@

#include <iostream>
#include <Ice/Ice.h>
#include <IceUtil/IceUtil.h>
#include <jderobot/camera.h>
#include <visionlib/colorspaces/colorspacesmm.h>
#include "viewer.h"
#include "parallelIce/cameraClient.h"
#include "easyiceconfig/EasyIce.h"
#include <jderobot/comm/cameraClient.hpp>
#include <jderobot/types/image.h>

int main(int argc, char** argv){

int status;
cameraview::Viewer viewer;
Ice::CommunicatorPtr ic;

jderobot::cameraClient* camRGB;

try{
ic = EasyIce::initialize(argc,argv);
Ice::ObjectPrx base = ic->propertyToProxy("Cameraview.Camera.Proxy");
Ice::PropertiesPtr prop = ic->getProperties();

if (0==base)
throw "Could not create proxy";
JdeRobotComm::CameraClient* camRGB;

ic = EasyIce::initialize(argc,argv);

camRGB = new jderobot::cameraClient(ic,"Cameraview.Camera.");
camRGB = JdeRobotComm::getCameraClient(ic, "Cameraview.Camera");

if (camRGB == NULL){
throw "Invalid proxy";
}
camRGB->start();
JdeRobotTypes::Image rgb;

cv::Mat rgb;
while(viewer.isVisible()){
//jderobot::ImageDataPtr data = camRGB->getImageData(format);

while(viewer.isVisible()){
//jderobot::ImageDataPtr data = camRGB->getImageData(format);

camRGB->getImage(rgb);
viewer.display(rgb);
viewer.displayFrameRate(camRGB->getRefreshRate());
}
}catch (const Ice::Exception& ex) {
std::cerr << ex << std::endl;
status = 1;
} catch (const char* msg) {
std::cerr << msg << std::endl;
status = 1;
rgb = camRGB->getImage();
viewer.display(rgb.data);
viewer.displayFrameRate(0);
}

if (ic)
ic->destroy();

camRGB->stop_thread();
delete(camRGB);

return status;
}
1 change: 0 additions & 1 deletion src/tools/cameraview/pioneer_left_cam.cfg

This file was deleted.

0 comments on commit 73cd006

Please sign in to comment.