GithubHelp home page GithubHelp logo

srv_tools's Introduction

srv_tools's People

Contributors

afakihcpr avatar awesomebytes avatar cottsay avatar joanpepcompany avatar matlabbe avatar miquelmassot avatar mmabadal avatar severin-lemaignan avatar stwirth avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

srv_tools's Issues

change_camera_info.py binning-x error

Hi,
First off, I want to say thanks for uploading and maintaining this package.
I've used some of the scripts for modifying bags before, but I've encountered an issue with change_camera_info.py.

ROS distro is Kinetic.

The package successfully compiles, but upon running it throws an error. I've made sure the topic exists within the bag file.

Downloaded from the Kinetic branch and also tested Indigo branch. Both throw the same error, preventing the new bag from being created.

Command:
rosrun bag_tools change_camera_info.py bag.bag bag_new_camera_info.bag /stereo/left/camera_info=left_calib.yaml

Traceback and Error:
Traceback (most recent call last):
File "/home/me/catkin_ws/src/srv_tools-kinetic/bag_tools/scripts/change_camera_info.py", line 92, in
args = parser.parse_args()
File "/usr/lib/python2.7/argparse.py", line 1701, in parse_args
args, argv = self.parse_known_args(args, namespace)
File "/usr/lib/python2.7/argparse.py", line 1733, in parse_known_args
namespace, args = self._parse_known_args(args, namespace)
File "/usr/lib/python2.7/argparse.py", line 1942, in _parse_known_args
stop_index = consume_positionals(start_index)
File "/usr/lib/python2.7/argparse.py", line 1898, in consume_positionals
take_action(action, args)
File "/usr/lib/python2.7/argparse.py", line 1791, in take_action
argument_values = self._get_values(action, argument_strings)
File "/usr/lib/python2.7/argparse.py", line 2245, in _get_values
value = [self._get_value(action, v) for v in arg_strings]
File "/usr/lib/python2.7/argparse.py", line 2260, in _get_value
result = type_func(arg_string)
File "/home/me/catkin_ws/src/srv_tools-kinetic/bag_tools/scripts/change_camera_info.py", line 78, in replacement
cam_info.binning_x = calib_data['binning_x']
KeyError: 'binning_x'

The .yaml file is as follows:
image_width: 1280
image_height: 960
camera_name: stereo/left
camera_matrix:
rows: 3
cols: 3
data: [1678.273323, 0.000000, 630.315407, 0.000000, 1676.400007, 481.936289, 0.000000, 0.000000, 1.000000]
distortion_model: plumb_bob
distortion_coefficients:
rows: 1
cols: 5
data: [-0.436874, 0.139979, -0.001818, -0.0004, 0.000000]
rectification_matrix:
rows: 3
cols: 3
data: [0.999975, -0.000608, -0.007024, 0.000586, 0.999995, -0.003169, 0.007026, 0.003165, 0.99997]
projection_matrix:
rows: 3
cols: 4
data: [1642.284735, 0.000000, 640.289375, 0.000000, 0.000000, 1642.284735, 481.001492, 0.000000, 0.000000, 0.000000, 1.000000, 0.000000]

Any help with this would be appreciated.

Thanks,

Cavusa

kinetic and melodic release?

Is there a plan for official releases into kinetic and melodic? Can I help with them somehow?

I've tried building the whole repo on melodic and there was no problem.

bag_add_time_offset fails to run

There's some incorrect code after running the bag_add_time_offset.py file

Traceback (most recent call last):
  File "/home/jrojas/work/projects/ros_stuff/catkin_ws/src/srv_tools/bag_tools/scripts/bag_add_time_offset.py", line 78, in <module>
    fix_bagfile(args.i, args.o, arg.t, args.of)
NameError: name 'arg' is not defined

I managed to fix this, then received another error:

Traceback (most recent call last):
  File "/home/jrojas/work/projects/ros_stuff/catkin_ws/src/srv_tools/bag_tools/scripts/bag_add_time_offset.py", line 78, in <module>
    fix_bagfile(args.i, args.o, args.t, args.of)
  File "/home/jrojas/work/projects/ros_stuff/catkin_ws/src/srv_tools/bag_tools/scripts/bag_add_time_offset.py", line 56, in fix_bagfile
    for topic, msg, t in rosbag.Bag(inbag).read_messages():
  File "/opt/ros/melodic/lib/python2.7/dist-packages/rosbag/bag.py", line 458, in __init__
    self._open(f, mode, allow_unindexed)
  File "/opt/ros/melodic/lib/python2.7/dist-packages/rosbag/bag.py", line 1415, in _open
    if   mode == 'r': self._open_read(f, allow_unindexed)
  File "/opt/ros/melodic/lib/python2.7/dist-packages/rosbag/bag.py", line 1437, in _open_read
    self._file     = open(f, 'rb')
TypeError: coercing to Unicode: need string or buffer, list found

I will send a PR to fix these.

apt-get installation is broken with indigo

Hi,

While trying to execute any of the tools, rosrun exits with an error:
[rosrun] Couldn't find executable named <NAME> below /opt/ros/indigo/share/<PACKAGE_NAME>

It seems that the python-based tools are installed to /opt/ros/indigo/lib/python2.7/dist-packages (which is not part of the standard ROS_PACKAGE_PATH environment variable, so rosrun won't look there by default):

$ find /opt/ros/indigo -name check_delay.py -follow
/opt/ros/indigo/lib/python2.7/dist-packages/bag_tools/check_delay.py
$ find /opt/ros/indigo -name launchViz.py -follow
/opt/ros/indigo/lib/python2.7/dist-packages/launch_tools/launchViz.py

This could be worked around in several ways, but the problem is that the binary tools (e.g. tf_logger) are not present at all. The only solution to get all srv_tools is to compile from source in which case, the tools are installed at the right locations in catkin workspace.

apt-get log:
Commandline: apt-get install --reinstall --yes ros-indigo-srv-tools
Install: ros-indigo-srv-tools:amd64 (0.0.1-0trusty-20170430-140120-0800), xdot:amd64 (0.5-2ubuntu0.1, automatic), ros-indigo-tf-tools:amd64 (0.0.1-0trusty-20170415-210717-0800, automatic), ros-indigo-launch-tools:amd64 (0.0.1-0trusty-20170313-091307-0700, automatic), ros-indigo-pointcloud-tools:amd64 (0.0.1-0trusty-20170415-224530-0800, automatic), ros-indigo-plot-tools:amd64 (0.0.1-0trusty-20170313-091359-0700, automatic), ros-indigo-bag-tools:amd64 (0.0.1-0trusty-20170430-134847-0800, automatic)

compilation error in bag_tools

Hi!
I get
[ 80%] Building CXX object srv_tools/bag_tools/CMakeFiles/extract_image_positions.dir/src/extract_image_positions.cpp.o /usr/local/src/catkin_ws/src/srv_tools/bag_tools/src/extract_image_positions.cpp: In member function ‘void ImagePositions::msgsCallback(const NavStsConstPtr&, const ImageConstPtr&, const CameraInfoConstPtr&)’: /usr/local/src/catkin_ws/src/srv_tools/bag_tools/src/extract_image_positions.cpp:83:48: error: ‘const _orientation_type {aka const struct geometry_msgs::Vector3_<std::allocator<void> >}’ has no member named ‘roll’ double roll = nav_sts_msg->orientation.roll; ^ /usr/local/src/catkin_ws/src/srv_tools/bag_tools/src/extract_image_positions.cpp:84:48: error: ‘const _orientation_type {aka const struct geometry_msgs::Vector3_<std::allocator<void> >}’ has no member named ‘pitch’ double pitch = nav_sts_msg->orientation.pitch; ^ /usr/local/src/catkin_ws/src/srv_tools/bag_tools/src/extract_image_positions.cpp:85:48: error: ‘const _orientation_type {aka const struct geometry_msgs::Vector3_<std::allocator<void> >}’ has no member named ‘yaw’ double yaw = nav_sts_msg->orientation.yaw; ^ srv_tools/bag_tools/CMakeFiles/extract_image_positions.dir/build.make:62: recipe for target 'srv_tools/bag_tools/CMakeFiles/extract_image_positions.dir/src/extract_image_positions.cpp.o' failed

using ros-kinetic as of today.

It compiles with

double roll = nav_sts_msg->orientation.x; double pitch = nav_sts_msg->orientation.y; double yaw = nav_sts_msg->orientation.z;
but I do not know if this complies to the docs. I think the api changed.
http://docs.ros.org/kinetic/api/auv_msgs/html/msg/NavSts.html
geometry_msgs/Vector3 orientation has no rpy.

Have fun

Edit: By the way, auv_msgs is not in the dependencies I can see.

Regression in Kinetic with OpenCV 3.3

Re: ros-infrastructure/rep#140 @vrabaud @mikaelarguedas FYI

http://build.ros.org/view/Kbin_uX64/job/Kbin_uX64__bag_tools__ubuntu_xenial_amd64__binary/25/console

00:04:39.904 In file included from /opt/ros/kinetic/include/opencv-3.3.1/opencv2/core.hpp:59:0,
00:04:39.904                  from /opt/ros/kinetic/include/opencv-3.3.1/opencv2/core/core.hpp:48,
00:04:39.904                  from /opt/ros/kinetic/include/image_proc/processor.h:37,
00:04:39.904                  from /opt/ros/kinetic/include/stereo_image_proc/processor.h:37,
00:04:39.904                  from /tmp/binarydeb/ros-kinetic-bag-tools-0.0.3/src/process_stereo.cpp:34:
00:04:39.904 /opt/ros/kinetic/include/opencv-3.3.1/opencv2/core/mat.hpp: In instantiation of ‘class cv::Mat_<unsigned int>’:
00:04:39.904 /opt/ros/kinetic/include/stereo_image_proc/processor.h:180:30:   required from here
00:04:39.904 /opt/ros/kinetic/include/opencv-3.3.1/opencv2/core/mat.hpp:2150:50: error: no type named ‘channel_type’ in ‘class cv::DataType<unsigned int>’
00:04:39.904      typedef typename DataType<_Tp>::channel_type channel_type;
00:04:39.904     

bag_tools not usable when installed via apt-get

I think the cause is the same as here:

#8

The python scripts are missing after installation, so no node can be started after installation, because the files can't be found. I could fix it with creating a new folder under:
/opt/ros//lib/
named bag_tools

I inserted the python scripts here (from srv_tools/bag_tools/scripts) and made sure they are executable. Afterwards I could use them and they are working fine apart from this.

EDIT: This is the error message:
Couldn't find executable named <name_of_python_file>.py below /opt/ros/indigo/share/bag_tools

Cannot install bag_tools by sudo apt-get install ros-kinetic-bag-tools

Hi, my ros version is kinetic,when I try to install bag_tools package by "sudo apt-get install ros-kinetic-bag-tools" but I got the error:
Reading package lists... Done
Building dependency tree
Reading state information... Done
Package ros-kinetic-bag-tools is not available, but is referred to by another package.
This may mean that the package is missing, has been obsoleted, or
is only available from another source

E: Package 'ros-kinetic-bag-tools' has no installation candidate
How to slove this problem? Is that mean bag_tools package does not support kinetic any more? Thanks a lot!

Build error

Hey,

I am getting a building error. upon using catkin_make command.

I am getting this.

[ 8%] Built target extract_stereo_images
[ 12%] Building CXX object srv_tools-kinetic/bag_tools/CMakeFiles/process_stereo.dir/src/process_stereo.cpp.o
[ 20%] Built target extract_images
[ 29%] Built target pointcloud_to_webgl
[ 37%] Built target pcd_publisher
[ 45%] Built target pointcloud_mapper_for_slam
[ 54%] Built target pointcloud_mapper
[ 70%] Built target tf_filter
[ 70%] Built target pointcloud_viewer
[ 79%] Built target pointcloud_filtering
[ 87%] Built target tf_logger
[ 95%] Built target apply_tf_to_odom_msg
In file included from /opt/ros/kinetic/include/opencv-3.3.1/opencv2/core.hpp:59:0,
from /opt/ros/kinetic/include/opencv-3.3.1/opencv2/core/core.hpp:48,
from /opt/ros/kinetic/include/image_proc/processor.h:37,
from /opt/ros/kinetic/include/stereo_image_proc/processor.h:37,
from /home/pallav/catkin_ws5/src/srv_tools-kinetic/bag_tools/src/process_stereo.cpp:34:
/opt/ros/kinetic/include/opencv-3.3.1/opencv2/core/mat.hpp: In instantiation of ‘class cv::Mat_’:
/opt/ros/kinetic/include/stereo_image_proc/processor.h:180:30: required from here
/opt/ros/kinetic/include/opencv-3.3.1/opencv2/core/mat.hpp:2150:50: error: no type named ‘channel_type’ in ‘class cv::DataType’
typedef typename DataType<Tp>::channel_type channel_type;
^
In file included from /opt/ros/kinetic/include/opencv-3.3.1/opencv2/core/mat.hpp:3639:0,
from /opt/ros/kinetic/include/opencv-3.3.1/opencv2/core.hpp:59,
from /opt/ros/kinetic/include/opencv-3.3.1/opencv2/core/core.hpp:48,
from /opt/ros/kinetic/include/image_proc/processor.h:37,
from /opt/ros/kinetic/include/stereo_image_proc/processor.h:37,
from /home/pallav/catkin_ws5/src/srv_tools-kinetic/bag_tools/src/process_stereo.cpp:34:
/opt/ros/kinetic/include/opencv-3.3.1/opencv2/core/mat.inl.hpp:1582:1: error: no type named ‘channel_type’ in ‘class cv::DataType’
Mat
<Tp>::Mat(const Vec<typename DataType<Tp>::channel_type, n>& vec, bool c
^
/opt/ros/kinetic/include/opencv-3.3.1/opencv2/core/mat.inl.hpp:1591:1: error: no type named ‘channel_type’ in ‘class cv::DataType’
Mat
<Tp>::Mat(const Matx<typename DataType<Tp>::channel_type, m, n>& M, bool
^
/opt/ros/kinetic/include/opencv-3.3.1/opencv2/core/mat.inl.hpp:1600:1: error: no type named ‘channel_type’ in ‘class cv::DataType’
Mat
<Tp>::Mat(const Point_<typename DataType<Tp>::channel_type>& pt, bool co
^
/opt/ros/kinetic/include/opencv-3.3.1/opencv2/core/mat.inl.hpp:1609:1: error: no type named ‘channel_type’ in ‘class cv::DataType’
Mat
<Tp>::Mat(const Point3_<typename DataType<Tp>::channel_type>& pt, bool c
^
/opt/ros/kinetic/include/opencv-3.3.1/opencv2/core/mat.inl.hpp:1938:1: error: no type named ‘channel_type’ in ‘class cv::DataType’
Mat
<_Tp>::operator Vec<typename DataType<Tp>::channel_type, n>() const
^
/opt/ros/kinetic/include/opencv-3.3.1/opencv2/core/mat.inl.hpp:1951:1: error: no type named ‘channel_type’ in ‘class cv::DataType’
Mat
<_Tp>::operator Matx<typename DataType<Tp>::channel_type, m, n>() const
^
In file included from /opt/ros/kinetic/include/opencv-3.3.1/opencv2/core.hpp:56:0,
from /opt/ros/kinetic/include/opencv-3.3.1/opencv2/core/core.hpp:48,
from /opt/ros/kinetic/include/image_proc/processor.h:37,
from /opt/ros/kinetic/include/stereo_image_proc/processor.h:37,
from /home/pallav/catkin_ws5/src/srv_tools-kinetic/bag_tools/src/process_stereo.cpp:34:
/opt/ros/kinetic/include/opencv-3.3.1/opencv2/core/traits.hpp: In instantiation of ‘struct cv::traits::Type’:
/opt/ros/kinetic/include/opencv-3.3.1/opencv2/core/mat.inl.hpp:1500:41: required from ‘cv::Mat
<Tp>::Mat() [with _Tp = unsigned int]’
/opt/ros/kinetic/include/stereo_image_proc/processor.h:60:3: required from here
/opt/ros/kinetic/include/opencv-3.3.1/opencv2/core/traits.hpp:366:8: error: ‘type’ is not a member of ‘cv::DataType’
{ enum { value = DataType::type }; };
^
srv_tools-kinetic/bag_tools/CMakeFiles/process_stereo.dir/build.make:62: recipe for target 'srv_tools-kinetic/bag_tools/CMakeFiles/process_stereo.dir/src/process_stereo.cpp.o' failed
make[2]: *** [srv_tools-kinetic/bag_tools/CMakeFiles/process_stereo.dir/src/process_stereo.cpp.o] Error 1
CMakeFiles/Makefile2:1036: recipe for target 'srv_tools-kinetic/bag_tools/CMakeFiles/process_stereo.dir/all' failed
make[1]: *** [srv_tools-kinetic/bag_tools/CMakeFiles/process_stereo.dir/all] Error 2
Makefile:138: recipe for target 'all' failed
make: *** [all] Error 2
Invoking "make -j4 -l4" failed

Please help!

auv_msg element naming

On Kinetic, using auv_msgs installed from ros-kinetic-auv-msgs.
Starting from here, the roll, pitch, and yaw elements are apparently erroneously named. Orientation is a geometry_msgs/Vector3, so the elements in orientation are named x, y, and z.

Error while Changing Frame ID using change_frame_id.py

vasanth@vasanthaw:~/catkin_ws$ rosrun bag_tools change_frame_id.py -i /home/vasanth/vijayawada/2018-10-30-08-17-42_0.bag -o /home/vasanth/vijayawada/2018-10-30-08-17-42_0_2.bag -f imu -t /imu/data
[INFO] [1540993697.486695]: Processing input bagfile: /home/vasanth/vijayawada/2018-10-30-08-17-42_0.bag
[INFO] [1540993697.487441]: Writing to output bagfile: /home/vasanth/vijayawada/2018-10-30-08-17-42_0_2.bag
[INFO] [1540993697.488037]: Changing topics: ['/imu/data']
[INFO] [1540993697.488550]: Writing frame_id: imu
Traceback (most recent call last):
File "/home/vasanth/catkin_ws/src/srv_tools/bag_tools/scripts/change_frame_id.py", line 68, in
change_frame_id(args.i,args.o,args.f,args.t)
File "/home/vasanth/catkin_ws/src/srv_tools/bag_tools/scripts/change_frame_id.py", line 49, in change_frame_id
for topic, msg, t in rosbag.Bag(inbag,'r').read_messages():
File "/opt/ros/kinetic/lib/python2.7/dist-packages/rosbag/bag.py", line 2337, in read_messages
yield self.seek_and_read_message_data_record((entry.chunk_pos, entry.offset), raw)
File "/opt/ros/kinetic/lib/python2.7/dist-packages/rosbag/bag.py", line 2475, in seek_and_read_message_data_record
msg_type = _get_message_type(connection_info)
File "/opt/ros/kinetic/lib/python2.7/dist-packages/rosbag/bag.py", line 1571, in _get_message_type
message_type = genpy.dynamic.generate_dynamic(info.datatype, info.msg_def)[info.datatype]
File "/opt/ros/kinetic/lib/python2.7/dist-packages/genpy/dynamic.py", line 168, in generate_dynamic
tmp_file.file.write(full_text.encode())
UnicodeDecodeError: 'ascii' codec can't decode byte 0xe2 in position 6125: ordinal not in range(128)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.