Hey guys, I'am new in this site but i think i will pretty active in the next few months!
My idea is program a drone so that it follows objects alone. I have some programming experience but i don't yet have a drone.
I know that the Parrot drones can be programmed with ROS and i get the idea that people who get into this projects follow that path, i'am i correct?
I found out recently that it's also possible to program DJI drones, how does that work?
I need the drone to have around 30 minutes of battery(ideally more, but if not possible that will do). The camera needs to be decent as well and i would also like the drone to be robust. (not fun burning $$).
So based on the above what drone would you recommend me, and how should i tackle this? (i'am thinking i need to study computer vision and learn to use OpenCV, what more?)
↧
Getting started in the world of drone programming
↧
How to save video stream ?
I want to record video with a usb webcam to process it later. To do that, I found limited info. One is to use `rosbag` to save published topics. Another way is to use opencv to write video. Which method would provide a simple solution to save video ? (maybe another alternative method beyond what I said) I have a source code of`image_pub`package to publish images as following;
#include
#include
#include
#include
#include
int main(int argc, char **argv)
{
ROS_INFO("Starting image_pub ROS node...\n");
ros::init(argc, argv, "image_pub");
ros::NodeHandle nh("~");
std::string camera_topic;
std::string camera_info_topic;
std::string camera_info_url;
std::string img_path;
std::string frame_id;
float pub_rate;
int start_sec;
bool repeat;
nh.param("camera_topic", camera_topic, "/camera/image_raw");
nh.param("camera_info_topic", camera_info_topic, "/camera/camera_info");
nh.param("camera_info_url", camera_info_url, "");
nh.param("img_path", img_path, "");
nh.param("frame_id", frame_id, "");
nh.param("pub_rate", pub_rate, 30.0f);
nh.param("start_sec", start_sec, 0);
nh.param("repeat", repeat, false);
ROS_INFO("CTopic : %s", camera_topic.c_str());
ROS_INFO("ITopic : %s", camera_info_topic.c_str());
ROS_INFO("CI URL : %s", camera_info_url.c_str());
ROS_INFO("Source : %s", img_path.c_str());
ROS_INFO("Rate : %.1f", pub_rate);
ROS_INFO("Start : %d", start_sec);
ROS_INFO("Repeat : %s", repeat ? "yes" : "no");
ROS_INFO("FrameID: %s", frame_id.c_str());
camera_info_manager::CameraInfoManager camera_info_manager(nh);
if (camera_info_manager.validateURL(camera_info_url))
camera_info_manager.loadCameraInfo(camera_info_url);
ros::Publisher img_pub = nh.advertise(camera_topic, 1);
ros::Publisher info_pub = nh.advertise(camera_info_topic, 1);
cv::VideoCapture vid_cap(img_path.c_str());
if (start_sec > 0)
vid_cap.set(CV_CAP_PROP_POS_MSEC, 1000.0 * start_sec);
ros::Rate rate(pub_rate);
while (ros::ok())
{
cv::Mat img;
if (!vid_cap.read(img))
{
if (repeat)
{
vid_cap.open(img_path.c_str());
if (start_sec > 0)
vid_cap.set(CV_CAP_PROP_POS_MSEC, 1000.0 * start_sec);
continue;
}
ROS_ERROR("Failed to capture frame.");
ros::shutdown();
}
else
{
//ROS_DEBUG("Image: %dx%dx%d, %zu, %d", img.rows, img.cols, img.channels(), img.elemSize(), img.type() == CV_8UC3);
if (img.type() != CV_8UC3)
img.convertTo(img, CV_8UC3);
// Convert image from BGR format used by OpenCV to RGB.
cv::cvtColor(img, img, CV_BGR2RGB);
auto img_msg = boost::make_shared();
img_msg->header.stamp = ros::Time::now();
img_msg->header.frame_id = frame_id;
img_msg->encoding = "rgb8";
img_msg->width = img.cols;
img_msg->height = img.rows;
img_msg->step = img_msg->width * img.channels();
auto ptr = img.ptr(0);
img_msg->data = std::vector(ptr, ptr + img_msg->step * img_msg->height);
img_pub.publish(img_msg);
if (camera_info_manager.isCalibrated())
{
auto info = boost::make_shared(camera_info_manager.getCameraInfo());
info->header = img_msg->header;
info_pub.publish(info);
}
}
ros::spinOnce();
rate.sleep();
}
return 0;
}
↧
↧
focal length of Ardrone front camera
Hello guys
Referring to formula **f_x = f * m_x** where f_x can be obtained from camera intrinsic parameter, i need to find m_x (pixel per millimeter), i need to know the focal length (f) for Ardrone front camera having resolution of 640x360.
any help would be appreciated.
Thanks
↧
ROS Melodic OpenCV xfeatures2d
On ROS Melodic ros-melodic-opencv3 doesn't exist anymore as e.g. on ROS Kinetic. Instead it is recommended to install libopencv-dev http://wiki.ros.org/melodic/Migration#opencv , however, this package does not contain xfeatures2d, neither does libopencv-contrib-dev.
How am I supposed do install xfeatures2d (SURF, SIFT, etc.)? Do I have to build OpenCV 3 now from source?
↧
Compiling OpenCV with GCC7 fails with fatal_error at stdlib include_next
Hello,
we're currently developing ROS support for our modules. Therefore we need to compile ROS Kinetic packages with the gcc-linaro-7.2.1-2017.11-x86_64_arm-linux-gnueabihf toolchain.
**I get the following error:**
[ 63%] Building CXX object modules/highgui/CMakeFiles/opencv_highgui.dir/src/window.cpp.o
In file included from /opt/gcc-linaro-7.2.1-2017.11-x86_64_arm-linux-gnueabihf/arm-linux-gnueabihf/include/c++/7.2.1/ext/string_conversions.h:41:0,
from /opt/gcc-linaro-7.2.1-2017.11-x86_64_arm-linux-gnueabihf/arm-linux-gnueabihf/include/c++/7.2.1/bits/basic_string.h:6349,
from /opt/gcc-linaro-7.2.1-2017.11-x86_64_arm-linux-gnueabihf/arm-linux-gnueabihf/include/c++/7.2.1/string:52,
from /opt/gcc-linaro-7.2.1-2017.11-x86_64_arm-linux-gnueabihf/arm-linux-gnueabihf/include/c++/7.2.1/stdexcept:39,
from /opt/gcc-linaro-7.2.1-2017.11-x86_64_arm-linux-gnueabihf/arm-linux-gnueabihf/include/c++/7.2.1/array:39,
from /ros_files_comm_cv/src/opencv3/modules/core/include/opencv2/core/cvdef.h:438,
from /ros_files_comm_cv/src/opencv3/modules/core/include/opencv2/core.hpp:52,
from /ros_files_comm_cv/src/opencv3/modules/highgui/include/opencv2/highgui.hpp:46,
from /ros_files_comm_cv/src/opencv3/modules/highgui/src/precomp.hpp:45,
from /ros_files_comm_cv/src/opencv3/modules/highgui/src/window.cpp:42:
/opt/gcc-linaro-7.2.1-2017.11-x86_64_arm-linux-gnueabihf/arm-linux-gnueabihf/include/c++/7.2.1/cstdlib:75:15: fatal error: stdlib.h: No such file or directory
#include_next **
^~~~~~~~~~
compilation terminated.
modules/highgui/CMakeFiles/opencv_highgui.dir/build.make:83: recipe for target 'modules/highgui/CMakeFiles/opencv_highgui.dir/src/window.cpp.o' failed
make[2]: *** [modules/highgui/CMakeFiles/opencv_highgui.dir/src/window.cpp.o] Error 1
CMakeFiles/Makefile2:3404: recipe for target 'modules/highgui/CMakeFiles/opencv_highgui.dir/all' failed
**My command looks like this:**
sudo ./src/catkin/bin/catkin_make_isolated -DCMAKE_TOOLCHAIN_FILE=/toolchains/rostoolchain.cmake --install --install-space /opt/ros-arm -DCMAKE_BUILD_TYPE=Release -DCATKIN_ENABLE_TESTING=false -DWITH_1394=OFF -DWITH_CUDA=OFF -DBUILD_opencv_gpu=OFF -DBUILD_opencv_videoio=OFF -DENABLE_PRECOMPILED_HEADERS=OFF
**My rostoolchain file looks like this:**
#File: rostoolchain.cmake
set(CMAKE_SYSTEM_PROCESSOR arm)
set(CMAKE_LIBRARY_PATH /opt/gcc-linaro-7.2.1-2017.11-x86_64_arm-linux-gnueabihf/arm-linux-gnueabihf/libc/usr/lib/)
set(CMAKE_C_COMPILER /opt/gcc-linaro-7.2.1-2017.11-x86_64_arm-linux-gnueabihf/bin/arm-linux-gnueabihf-gcc)
set(CMAKE_CXX_COMPILER /opt/gcc-linaro-7.2.1-2017.11-x86_64_arm-linux-gnueabihf/bin/arm-linux-gnueabihf-g++)
set(CMAKE_FIND_ROOT_PATH /opt/gcc-linaro-7.2.1-2017.11-x86_64_arm-linux-gnueabihf/arm-linux-gnueabihf/libc)
set(CMAKE_INCLUDE_PATH /opt/gcc-linaro-7.2.1-2017.11-x86_64_arm-linux-gnueabihf/arm-linux-gnueabihf/libc/usr/include/)
set(CMAKE_C_FLAGS -I/opt/gcc-linaro-7.2.1-2017.11-x86_64_arm-linux-gnueabihf/arm-linux-gnueabihf/libc/usr/include)
#Have to set this one to BOTH, to allow CMake to find rospack
set(CMAKE_FIND_ROOT_PATH_MODE_PROGRAM NEVER)
set(CMAKE_FIND_ROOT_PATH_MODE_LIBRARY ONLY)
set(CMAKE_FIND_ROOT_PATH_MODE_INCLUDE ONLY)
__________________________________________________________________________
I already found out that there was a problem when upgrading from GCC5 to GCC6. The problem was solved by adding **-DENABLE_PRECOMPILED_HEADERS=OFF** to the command. But this only shifts my error from 25% building to 62% building.
When I remove the '_next' at
/opt/gcc-linaro-7.2.1-2017.11-x86_64_arm-linux-gnueabihf/arm-linux-gnueabihf/include/c++/7.2.1**/cstdlib:75:15
#include_next
everything works fine.
But I need a solution that doesn't require a change in the toolchain. Maybe somebody is fighting with the same issue? Does anybody know another solution for my problem?
↧
↧
undefined reference to everything
Hi,
I have a package in my workspace that uses openCV and cv_bridge. I needed the cuda module of openCV, but it doesn't exist in the default openCV of ROS. I installed another version of openCV that included the cuda modules, I tried to link my workspace and my package to the new openCV and I had lots of errors like "undefined reference to 'cv_bridge::...' ", "undefined reference to 'ros::init::...' ", "undefined reference to 'rosbag::...' ". I tried to solve the problems but I wasn't able, so I tried to return to the default openCV (it worked fine with my package before I tried to use cuda, etc.), but it gives the same errors now. I have uninstalled and reinstalled ROS, deleted my workspace and the package and I have created them again, but I have the same errors. I have all the dependencies in the CMakeLists.txt.
These are some of the errors:
undefined reference to 'cv_bridge::toCvCopy(boost::shared_ptr> const> const&, std::string const&)'
undefined reference to 'ros::console::initializeLogLocation(ros::console::LogLocation*, std::string const&, ros::console::levels::Level)'
undefined reference to 'ros::init(int&, char**, std::string const&, unsigned int)'
undefined reference to 'ros::NodeHandle::NodeHandle(std::string const&, std::map, std::allocator>> const&)'
undefined reference to 'rosbag::Bag::open(std::string const&, unsigned int)'
undefined reference to 'rosbag::TypeQuery::TypeQuery(std::string const&)'
undefined reference to 'rosbag::MessageInstance::getTopic() const'
undefined reference to 'pcl_ros::transformPointCloud(std::string const&, sensor_msgs::PointCloud2_> const&, sensor_msgs::PointCloud2_>&, tf::TransformListener const&)'
undefined reference to 'pcl::PCDWriter::writeBinary(std::string const&, pcl::PCLPointCloud2 const&, Eigen::Matrix const&, Eigen::Quaternion const&)'
undefined reference to 'pcl::PCDWriter::writeASCII(std::string const&, pcl::PCLPointCloud2 const&, Eigen::Matrix const&, Eigen::Quaternion const&, int)'
undefined reference to 'rosbag::MessageInstance::getMD5Sum() const'
undefined reference to 'rosbag::Bag::readField(std::map, std::allocator>> const&, std::string const&, bool, std::string&) const'
undefined reference to 'rosbag::Bag::readField(std::map, std::allocator>> const&, std::string const&, bool, std::string&) const'
...
collect2: error: ld returned 1 exit status
b_c_f/CMakeFiles/bag_to_pcd.dir/build.make:990: recipe for target '/home/portico/catkin_ws/devel/lib/b_c_f/bag_to_pcd' failed
make[2]: *** [/home/portico/catkin_ws/devel/lib/b_c_f/bag_to_pcd] Error 1
CMakeFiles/Makefile2:1642: recipe for target 'b_c_f/CMakeFiles/bag_to_pcd.dir/all' failed
make[1]: *** [b_c_f/CMakeFiles/bag_to_pcd.dir/all] Error 2
Makefile:138: recipe for target 'all' failed
make: *** [all] Error 2
Invoking "make -j8 -l8" failed
I don't know if trying to use the new openCV I have changed something in my CMakeLists.txt or package.xml, so I add them here.
CMakeLists.txt:
cmake_minimum_required(VERSION 2.8.3)
project(b_c_f)
## Compile as C++11, supported in ROS Kinetic and newer
# add_compile_options(-std=c++11)
## Find catkin macros and libraries
## if COMPONENTS list like find_package(catkin REQUIRED COMPONENTS xyz)
## is used, also find other catkin packages
find_package(PCL REQUIRED)
find_package(OpenCV REQUIRED)
find_package(catkin REQUIRED COMPONENTS
cv_bridge
pcl_conversions
pcl_msgs
pcl_ros
rosbag
roscpp
sensor_msgs
tf
)
###################################
## catkin specific configuration ##
###################################
## The catkin_package macro generates cmake config files for your package
## Declare things to be passed to dependent projects
## INCLUDE_DIRS: uncomment this if your package contains header files
## LIBRARIES: libraries you create in this project that dependent projects also need
## CATKIN_DEPENDS: catkin_packages dependent projects also need
## DEPENDS: system dependencies of this project that dependent projects also need
catkin_package(
# INCLUDE_DIRS include
# LIBRARIES b_c_f
# CATKIN_DEPENDS cv_bridge pcl_conversions pcl_msgs pcl_ros rosbag roscpp sensor_msgs tf
# DEPENDS system_lib
)
###########
## Build ##
###########
## Specify additional locations of header files
## Your package locations should be listed before other locations
include_directories(
include
include/b_c_f
src/log
${catkin_INCLUDE_DIRS}
${PCL_INCLUDE_DIRS}
${OpenCV_INCLUDE_DIRS}
)
## Declare a C++ executable
## With catkin_make all packages are built within a single CMake context
## The recommended prefix ensures that target names across packages don't collide
add_executable(bag_to_pcd
src/BagCameraFiltering.cpp
src/Blob.cpp
src/timing-helper.cpp
src/Tracker.cpp
src/Vehicle.cpp
src/log/Logger.cpp
src/log/LogItem.cpp
src/log/Log.cpp
src/log/Thread.cpp
#include/bag_camera_filtering/Vehicle.h
)
## Specify libraries to link a library or executable target against
target_link_libraries(bag_to_pcd
${catkin_LIBRARIES}
${OpenCV_LIBS}
${PCL_LIBRARIES}
)
package.xml:
b_c_f 0.0.0 The b_c_f package portico TODO catkin cv_bridge pcl_conversions pcl_msgs pcl_ros rosbag roscpp sensor_msgs tf cv_bridge pcl_conversions pcl_msgs pcl_ros rosbag roscpp sensor_msgs tf cv_bridge pcl_conversions pcl_msgs pcl_ros rosbag roscpp sensor_msgs tf
I don't know anything about how the bash or bashrc should be so the problem could be there too.
Pd: I cloned the cv_bridge from github as another package in my catkin_ws but that didn't solve anything.
Please, I need help!
↧
opencv video_stream crash for webcam
Hi,
Im using ROS kinetic with ubuntu 16
I tried to run the following:
sudo apt-get install ros-kinetic-video-stream-opencv
source devel/setup.bash
roslaunch video_stream_opencv webcam.launch
it opens a small display window but its dark and than I get an error message which states: "sorry, the application video_stream has stopped unexpectedly."
on the command prompt there's the following output:
... logging to /home/tester/.ros/log/7c3f439c-215d-11e9-93d6-a434d94983a6/roslaunch-tester-XPS-13-9350-20451.log
Checking log directory for disk usage. This may take awhile.
Press Ctrl-C to interrupt
Done checking log file disk usage. Usage is <1GB.
started roslaunch server http://tester-XPS-13-9350:44108/
SUMMARY
PARAMETERS
* /rosdistro: kinetic
* /rosversion: 1.12.12
* /webcam/webcam_stream/buffer_queue_size: 1
* /webcam/webcam_stream/camera_info_url:
* /webcam/webcam_stream/camera_name: webcam
* /webcam/webcam_stream/flip_horizontal: False
* /webcam/webcam_stream/flip_vertical: False
* /webcam/webcam_stream/fps: 30.0
* /webcam/webcam_stream/frame_id: webcam_optical_frame
* /webcam/webcam_stream/height: 0
* /webcam/webcam_stream/loop_videofile: False
* /webcam/webcam_stream/set_camera_fps: 30.0
* /webcam/webcam_stream/video_stream_provider: 0
* /webcam/webcam_stream/width: 0
NODES
/webcam/
webcam_image_view (image_view/image_view)
webcam_stream (video_stream_opencv/video_stream)
ROS_MASTER_URI=http://localhost:11311
process[webcam/webcam_stream-1]: started with pid [20468]
process[webcam/webcam_image_view-2]: started with pid [20469]
[ INFO] [1548701307.750201298]: Resource video_stream_provider: 0
[ INFO] [1548701307.750265122]: Getting video from provider: /dev/video0
[ INFO] [1548701307.969115605]: Video stream provider type detected: videodevice
[ INFO] [1548701307.972647577]: Camera name: webcam
[ INFO] [1548701307.975877216]: Setting camera FPS to: 30
[ INFO] [1548701307.979017728]: Camera reports FPS: 30
[ INFO] [1548701307.983787903]: Setting buffer size for capturing frames to: 1
[ INFO] [1548701307.988602391]: Throttling to fps: 30
[ INFO] [1548701307.991712224]: Publishing with frame_id: webcam_optical_frame
[ INFO] [1548701307.994771983]: Provided camera_info_url: ''
[ INFO] [1548701307.998538313]: Flip horizontal image is: false
[ INFO] [1548701308.002029133]: Flip vertical image is: false
[ INFO] [1548701308.015348365]: using default calibration URL
[ INFO] [1548701308.015553150]: camera calibration URL: file:///home/tester/.ros/camera_info/webcam.yaml
[ INFO] [1548701308.015712941]: Unable to open camera calibration file [/home/tester/.ros/camera_info/webcam.yaml]
[ WARN] [1548701308.015782408]: Camera calibration file /home/tester/.ros/camera_info/webcam.yaml not found.
[ INFO] [1548701308.015847803]: Opened the stream, starting to publish.
[ WARN] [1548701308.616463773]: No calibration file given, publishing a reasonable default camera info.
[ INFO] [1548701308.616540568]: The image width is: 640
[ INFO] [1548701308.616565884]: The image height is: 480
[webcam/webcam_stream-1] process has died [pid 20468, exit code -11, cmd /opt/ros/kinetic/lib/video_stream_opencv/video_stream camera:=image_raw __name:=webcam_stream __log:=/home/tester/.ros/log/7c3f439c-215d-11e9-93d6-a434d94983a6/webcam-webcam_stream-1.log].
log file: /home/tester/.ros/log/7c3f439c-215d-11e9-93d6-a434d94983a6/webcam-webcam_stream-1*.log
---------------------
What am I doing wrong and how do I solve this?
thank you!
↧
create point cloud2 from depth image
Hi, I have a image message of depth image. I need to create point cloud2 from that message, how can I do it?
I don't have camera info!!!. I couldn't find any document for that. please help me.
↧
OpenCV camera rvec tvec to ROS world pose
I'm detecting Aruco tags using the OpenCV bridge and I have tvec and rvec returned with the tag pose related to the camera using OpenCV axis notations. I would like convert them to a ROS pose related to the camera frame, so I can visualize the tag pose in the world frame using RVIZ. What would be the best approach?
↧
↧
How to use pcl with cuda
Hi,
I want to use pcl and openCV with cuda. I know now that I have to install another version of openCV (since the default version of openCV in ROS kinetic does not include cuda modules) and then call `catkin_make -DOpenCV_DIR=...` to use the new version. But now I have to use cuda with pcl too, and I have seen that there is no cuda modules in the default ROS installation (same as openCV). Do I need to install pcl outside ROS like with openCV? And then how can I use cuda?
Thank you.
↧
How do I change the version of a package being used? Specifically, I want to downgrade the version of opencv being used.
I want to change the version of opencv I am using to fix a problem I am having, or to at least rule out the version update as the problem cause. The problem is described [here](https://answers.ros.org/question/280018/apriltag_detector-node-crashes-after-viewing-an-apriltag-receive-opencv-error/).
Downgrading the package using apt-get does not work because the package source is not available. I used the following commands to download an archived version(current version 3.3.1):
>wget -O opencv_contrib.zip https://github.com/opencv/opencv_contrib/archive/3.3.0.zip>unzip opencv_contrib.zip
The unzipped file is 'opencv-3.3.0'. Initially moved the unzipped file to the src directory of my catkin workspace and executed catkin_make from the top of the work space. The build exited with errors.
Next, I moved the file to the /opt/src/kinetic/include directory where opencv-3.3.1 was located. Then I changed the files cv_bridge-extras.cmake and cv_bridgeConfig.cmake in the directory /opt/ros/kinetic/share/cv_bridge/cmake/ to reflect the version information and location that I wanted. I executed catkin_make again. There were no errors but does not finish. It gets hung up at:
>[ 93%] Building CXX object apriltags_ros/apriltags_ros/CMakeFiles/apriltag_detector_nodelet.dir/src/apriltag_detector_nodelet.cpp.o
After about 15 minutes I interrupt the build and the following output is produced:
> ^CTraceback (most recent call last): > File> "/opt/ros/kinetic/bin/catkin_make",> line 296, in > sys.exit(main()) File "/opt/ros/kinetic/bin/catkin_make",> line 240, in main>>run_command(cmd, make_path) File "/opt/ros/kinetic/lib/python2.7/dist-packages/catkin/builder.py",> line 239, in run_command> proc.wait() File "/usr/lib/python2.7/subprocess.py",> line 1392, in wait> pid, sts = _eintr_retry_call(os.waitpid, self.pid, 0) File> "/usr/lib/python2.7/subprocess.py",> line 476, in _eintr_retry_call> return func(*args)>> KeyboardInterruptapriltags_ros/apriltags_ros/CMakeFiles/apriltag_detector_nodelet.dir/build.make:62:> recipe for target> 'apriltags_ros/apriltags_ros/CMakeFiles/apriltag_detector_nodelet.dir/src/apriltag_detector_nodelet.cpp.o'> failed> apriltags_ros/apriltags_ros/CMakeFiles/apriltag_detector_node.dir/build.make:62:> recipe for target> 'apriltags_ros/apriltags_ros/CMakeFiles/apriltag_detector_node.dir/src/apriltag_detector_node.cpp.o'> failed make[2]: ***> [apriltags_ros/apriltags_ros/CMakeFiles/apriltag_detector_node.dir/src/apriltag_detector_node.cpp.o]> Interrupt make[2]: ***> [apriltags_ros/apriltags_ros/CMakeFiles/apriltag_detector_nodelet.dir/src/apriltag_detector_nodelet.cpp.o]> Interrupt>> CMakeFiles/Makefile2:987: recipe for> target> 'apriltags_ros/apriltags_ros/CMakeFiles/apriltag_detector_node.dir/all'> failed make[1]: ***> [apriltags_ros/apriltags_ros/CMakeFiles/apriltag_detector_node.dir/all]> Interrupt CMakeFiles/Makefile2:1968:> recipe for target> 'apriltags_ros/apriltags_ros/CMakeFiles/apriltag_detector_nodelet.dir/all'> failed make[1]: ***> [apriltags_ros/apriltags_ros/CMakeFiles/apriltag_detector_nodelet.dir/all]> Interrupt Makefile:138: recipe for> target 'all' failed make: *** [all]> Interrupt
↧
Source code Kinetic install fails on Fedora when can't find opencv tar file
Source code Kinetic install fails on Fedora when can't find opencv tar file. I get this error:
[localhost ros_catkin_ws]$ /usr/bin/wstool init -j8 src kinetic-desktop-full-wet.rosinstall
Using initial elements from: kinetic-desktop-full-wet.rosinstall
Writing /home/seanjohnson/ros_catkin_ws/src/.rosinstall
ERROR in config: Failed to install tree '/home/seanjohnson/ros_catkin_ws/src/opencv3'
Aborting install because of Failed to detect tar presence at /home/seanjohnson/ros_catkin_ws/src/opencv3.
In which ROS file is the path to the tar file defined so that I know where it is looking? And/or do you know the path?
There is a bug in installation routine for Kinetic where opencv3 is not installed properly.
Thanks.
↧
ROS2 Windows OpenCV self package?
Hi,
I have finished migrating a ROS package to ROS2 and I am currently going to test it on Windows.
I had a question regarding the installation of [OpenCV](https://index.ros.org/doc/ros2/Installation/Windows-Install-Binary/#id8).
Is there a particular reason why OpenCV is precompiled instead of using the OpenCV versions available in chocolate [repository](https://chocolatey.org/packages/OpenCV)?
↧
↧
tf and image stitching with multiple camera topics
I'm looking to mount two cameras on the left and right in parallel on the base of a mobile robot, stitch the images taken from the respective camera topics together and run them through a CNN to determine the pose of objects in a scene. My question relates to how image stitching will affect the outcome of the detection process when attempting to detect object that can only be fully seen with both cameras.
What sort of packages or processes already exist to extract objects from stitched images and how accurate are they?
↧
How to calculate the distance to object with orbbec astra camera
Hello, I am using orbbec Astra camera in order to get the distance to the already detected object. I have detected the object by using OpenCV and /brg/image_raw topic from Astra camera. Now I want to estimate the distance to the object by using depth in order to send command (move forward or stay) to the robot. I am tracking that object. Could someone help me with that, or where I can find the material about distance estimation with orbbec camera.
↧
How to update cv::namedwindow in multi-threading environment?
If 1 out of 2 subscriber receives an image and performs some image-processing. How can the output image be shown in multi-threading environment?
And, one more query: Is using `waitkey(1)`, optimal for real-time application?
class storedData {
public:
cv::Mat im, depth, outIm;
void imCallback(const sensor_msgs::CompressedImageConstPtr& msgIm) {
im = cv::imdecode(cv::Mat(msgIm->data),3);
}
void depthCallback(const sensor_msgs::CompressedImageConstPtr& msgDepth)
{
depth = cv::imdecode(cv::Mat(msgDepth->data),0);
// Performs something using both images(im & depth), Result : outIm //
cv::imshow("view", outIm);
cv::waitKey(1);
}
};
int main(int argc, char **argv)
{
ros::init(argc, argv, "PredictiveDisplay");
ros::NodeHandle nh;
storedData obj;
cv::namedWindow("view", 0);
cv::startWindowThread();
ros::Subscriber subIm = nh.subscribe("/image", 2, &storedData::imCallback, &obj);
ros::Subscriber subDepth = nh.subscribe("/depth", 2, &storedData::depthCallback, &obj);
ros::AsyncSpinner spinner(2);
spinner.start();
ros::waitForShutdown();
cv::destroyWindow("view");
}
↧
display a 16-bit grayscale images from a thermal camera in OpenCV
Hi Guys, I am struggling to display a 16-bit grayscale images from a FLIR tau 2 thermal camera in OpenCV. I tried different images' encoding but what I get is either totally black or totally white picture. my code looks like this:
void imageCallback(const sensor_msgs::ImageConstPtr& img)
{
cv_bridge::CvImagePtr cv_ptr;
cv_ptr = cv_bridge::toCvCopy(img);
cv::imshow("16-bit Mono", cv_ptr->image);
cv::waitKey(1);
}
I appreciate any help!
↧
↧
Tutorial for Image Publisher/Subscriber in Python (Video Stream)
Is there any tutorial or code for image publisher/subscriber in Python?
[http://wiki.ros.org/image_transport/Tutorials/PublishingImages#Adding_video_stream_from_a_webcam](http://wiki.ros.org/image_transport/Tutorials/PublishingImages#Adding_video_stream_from_a_webcam)
The code works perfectly using images in C++ but when I run the video stream code, I get an error:
kubuntu@ros-kubuntu:~/catkin_ws$ rosrun image_transport_tutorial my_subscriber
QSettings::value: Empty key passed
QSettings::value: Empty key passed
OpenCV Error: Assertion failed (size.width>0 && size.height>0) in imshow, file /tmp/binarydeb/ros-kinetic-opencv3-3.3.1/modules/highgui/src/window.cpp, line 331
terminate called after throwing an instance of 'cv::Exception'
what(): /tmp/binarydeb/ros-kinetic-opencv3-3.3.1/modules/highgui/src/window.cpp:331: error: (-215) size.width>0 && size.height>0 in function imshow
Aborted (core dumped)
There are a lot of python code for image publish and subscribe but I see none for video stream from a webcam.
↧
Can't install ros-kinetic-opencv3
I am trying to install `opencv3` using terminal. After saying
sudo apt-get update
i tried
sudo apt-get install ros-kinetic-opencv3
But i am getting this error and called: can't find file to patch.
Downloading kernel sources...
Reading package lists...
Picking 'linux-signed-hwe' as source package instead of 'linux-image-4.15.0-46-generic'
Need to get 12,3 kB of source archives.
Get:1 http://de.archive.ubuntu.com/ubuntu xenial-updates/main linux-signed-hwe 4.15.0-48.51~16.04.1 (dsc) [1.829 B]
Get:2 http://de.archive.ubuntu.com/ubuntu xenial-updates/main linux-signed-hwe 4.15.0-48.51~16.04.1 (tar) [10,4 kB]
gpgv: Signature made Fr 05 Apr 2019 13:57:42 CEST using RSA key ID 70E1162B
gpgv: Can't check signature: public key not found
dpkg-source: warning: failed to verify signature on ./linux-signed-hwe_4.15.0-48.51~16.04.1.dsc
dpkg-source: info: extracting linux-signed-hwe in linux-signed-hwe-4.15.0
dpkg-source: info: unpacking linux-signed-hwe_4.15.0-48.51~16.04.1.tar.xz
WFetched 12,3 kB in 0s (34,0 kB/s)
: Can't drop privileges for downloading as file 'linux-signed-hwe_4.15.0-48.51~16.04.1.dsc' couldn't be accessed by user '_apt'. - pkgAcquire::Run (13: Permission denied)
grep: drivers/media/usb/uvc/uvc_driver.c: No such file or directory
INFO: No Intel RealSense(TM) cameras are currently supported.
Patching uvcvideo sources...
can't find file to patch at input line 5
Perhaps you used the wrong -p or --strip option?
The text leading up to this was:
|diff --git a/drivers/media/usb/uvc/Makefile b/drivers/media/usb/uvc/Makefile
|index c26d12fdb8f4..d86cf22155d1 100644
|--- a/drivers/media/usb/uvc/Makefile
|+++ b/drivers/media/usb/uvc/Makefile
File to patch:
↧
Combines message for image and information gives "invalid initialization error"
Hello,
I am currently trying to implement a message that includes the images as well as the detected bounding boxes.
The publisher works very well, but the subscriber gives me the following error message:
In file included from /usr/include/boost/function/detail/maybe_include.hpp:18:0,
from /usr/include/boost/function/detail/function_iterate.hpp:14,
from /usr/include/boost/preprocessor/iteration/detail/iter/forward1.hpp:52,
from /usr/include/boost/function.hpp:64,
from /opt/ros/kinetic/include/ros/forwards.h:40,
from /opt/ros/kinetic/include/ros/common.h:37,
from /opt/ros/kinetic/include/ros/ros.h:43,
from /home/marvin/catkin_ws/src/efr_object_detection_camera/src/template_matching.cpp:5:
/usr/include/boost/function/function_template.hpp: In instantiation of ‘static void boost::detail::function::void_function_invoker1::invoke(boost::detail::function::function_buffer&, T0) [with FunctionPtr = void (*)(const darknet_ros_msgs::ImageWithBoundingBoxes_>&); R = void; T0 = const boost::shared_ptr>>&]’:
/usr/include/boost/function/function_template.hpp:940:38: required from ‘void boost::function1::assign_to(Functor) [with Functor = void (*)(const darknet_ros_msgs::ImageWithBoundingBoxes_>&); R = void; T0 = const boost::shared_ptr>>&]’
/usr/include/boost/function/function_template.hpp:728:7: required from ‘boost::function1::function1(Functor, typename boost::enable_if_c::value>::value, int>::type) [with Functor = void (*)(const darknet_ros_msgs::ImageWithBoundingBoxes_>&); R = void; T0 = const boost::shared_ptr>>&; typename boost::enable_if_c::value>::value, int>::type = int]’
/usr/include/boost/function/function_template.hpp:1077:16: required from ‘boost::function::function(Functor, typename boost::enable_if_c::value>::value, int>::type) [with Functor = void (*)(const darknet_ros_msgs::ImageWithBoundingBoxes_>&); R = void; T0 = const boost::shared_ptr>>&; typename boost::enable_if_c::value>::value, int>::type = int]’
/home/marvin/catkin_ws/src/efr_object_detection_camera/src/template_matching.cpp:55:26: required from here
/usr/include/boost/function/function_template.hpp:118:11: error: invalid initialization of reference of type ‘const darknet_ros_msgs::ImageWithBoundingBoxes_>&’ from expression of type ‘const boost::shared_ptr>>’
BOOST_FUNCTION_RETURN(f(BOOST_FUNCTION_ARGS));
^
This is the message in question:
> Header header > Header image_header> BoundingBox[] bounding_boxes> sensor_msgs/Image im
And this is my subscriber:
void imageCallback(const darknet_ros_msgs::ImageWithBoundingBoxes& msg) {
cv_bridge::CvImagePtr cv_ptr;
try {
cv_ptr = cv_bridge::toCvCopy(msg.im, sensor_msgs::image_encodings::BGR8);
Mat image = cv_ptr->image;
for(size_t i = 0; i < msg.bounding_boxes.size(); i++)
{
darknet_ros_msgs::BoundingBox bBox= msg.bounding_boxes[i];
double minx = bBox.xmin;
double miny = bBox.ymin;
double maxx = bBox.xmax;
double maxy = bBox.ymax;
match(image);
}
cv::waitKey(30);
} catch (cv_bridge::Exception& e) {
ROS_ERROR("Could not convert from '%s' to 'bgr8'.",
msg.im.encoding.c_str());
}
}
int main(int argc, char **argv) {
ros::init(argc, argv, "template_matching_node");
ros::NodeHandle nh;
cv::namedWindow("view");
cv::startWindowThread();
image_transport::ImageTransport it(nh);
image_transport::Subscriber sub = it.subscribe("/darknet_ros/ImageWithBoundingBoxes", 1,
imageCallback);
ros::spin();
cv::destroyWindow("view");
ros::shutdown();
return 0;
}
Could anybody help me to fix that error?
Thanks!
I am using kinetic kame with Ubuntu 16.04 and as you can see everything is programmed in C++.
For any further information please ask!
↧