Skip to content

Commit

Permalink
fix to work with librealsense v2.17.0 (#555)
Browse files Browse the repository at this point in the history
fixed to work with librealsense v2.17.0
  • Loading branch information
doronhi authored Dec 24, 2018
1 parent 76b8f82 commit c5ea272
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 7 deletions.
3 changes: 0 additions & 3 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -26,9 +26,6 @@ install:
- source ~/.bashrc
- mkdir -p ~/catkin_ws/src/realsense

# download ddynamic_reconfigure:
- git clone -v --progress https://github.com/awesomebytes/ddynamic_reconfigure.git

# install realsense2-camera
- mv * ~/catkin_ws/src/realsense/ # This leaves behind .git, .gitignore and .travis.yml but no matter.
- cd ~/catkin_ws/src/
Expand Down
1 change: 0 additions & 1 deletion realsense2_camera/include/base_realsense_node.h
Original file line number Diff line number Diff line change
Expand Up @@ -137,7 +137,6 @@ namespace realsense2_camera
const std::string& to);
void publishStaticTransforms();
void publishPointCloud(rs2::points f, const ros::Time& t, const rs2::frameset& frameset);
rs2::frame get_frame(const rs2::frameset& frameset, const rs2_stream stream, const int index = 0);
Extrinsics rsExtrinsicsToMsg(const rs2_extrinsics& extrinsics, const std::string& frame_id) const;
rs2_extrinsics getRsExtrinsics(const stream_index_pair& from_stream, const stream_index_pair& to_stream);

Expand Down
9 changes: 6 additions & 3 deletions realsense2_camera/src/base_realsense_node.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1578,9 +1578,12 @@ void BaseRealSenseNode::publishPointCloud(rs2::points pc, const ros::Time& t, co
{
std::set<rs2_format> available_formats{ rs2_format::RS2_FORMAT_RGB8, rs2_format::RS2_FORMAT_Y8 };

texture_frame_itr = find_if(frameset.begin(), frameset.end(), [&texture_source_id, &available_formats] (rs2::frame f)
{return (rs2_stream(f.get_profile().stream_type()) == texture_source_id) &&
(available_formats.find(f.get_profile().format()) != available_formats.end()); });
for (texture_frame_itr = frameset.begin();
texture_frame_itr != frameset.end() &&
((*texture_frame_itr).get_profile().stream_type() != texture_source_id ||
available_formats.find((*texture_frame_itr).get_profile().format()) == available_formats.end());
++texture_frame_itr);

if (texture_frame_itr == frameset.end())
{
std::string texture_source_name = pc_filter->_filter->get_option_value_description(rs2_option::RS2_OPTION_STREAM_FILTER, static_cast<float>(texture_source_id));
Expand Down

0 comments on commit c5ea272

Please sign in to comment.