Skip to content

Commit

Permalink
fixed a few deprecated methods, changed includes, and fixed what appe…
Browse files Browse the repository at this point in the history
…ars to be a timeout issue on the rviz display of the map
  • Loading branch information
josephduchesne committed Oct 19, 2024
1 parent fc3f233 commit adbd168
Show file tree
Hide file tree
Showing 12 changed files with 24 additions and 16 deletions.
2 changes: 1 addition & 1 deletion flatland_plugins/src/diff_drive.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@
#include <flatland_server/model_plugin.h>
#include <tf2/LinearMath/Quaternion.h>
#include <tf2/convert.h>
#include <tf2_geometry_msgs/tf2_geometry_msgs.h>
#include <tf2_geometry_msgs/tf2_geometry_msgs.hpp>

#include <geometry_msgs/msg/transform_stamped.hpp>
#include <pluginlib/class_list_macros.hpp>
Expand Down
2 changes: 1 addition & 1 deletion flatland_plugins/src/tricycle_drive.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@
#include <flatland_server/yaml_reader.h>
#include <tf2/LinearMath/Quaternion.h>
#include <tf2/convert.h>
#include <tf2_geometry_msgs/tf2_geometry_msgs.h>
#include <tf2_geometry_msgs/tf2_geometry_msgs.hpp>

#include <memory>
#include <pluginlib/class_list_macros.hpp>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@
#include <OgreEntity.h>
#include <OgreSceneManager.h>
#include <OgreSceneNode.h>
#include <OgreVector3.h>
#include <Ogre.h>

#include <QCursor>
#include <QDialog>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@
#include <OgreEntity.h>
#include <OgreSceneManager.h>
#include <OgreSceneNode.h>
#include <OgreVector3.h>
#include <Ogre.h>

#include <flatland_msgs/srv/spawn_model.hpp>
#include <rclcpp/rclcpp.hpp>
Expand Down
4 changes: 2 additions & 2 deletions flatland_rviz_plugins/src/load_model_dialog.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@

#include <string>

#include <OgreVector3.h>
#include <Ogre.h>

#include <QCheckBox>
#include <QCursor>
Expand Down Expand Up @@ -173,7 +173,7 @@ void LoadModelDialog::OkButtonClicked()

void LoadModelDialog::AddNumberAndUpdateName()
{
std::string bsfn = boost::filesystem::basename(path_to_model_file.toStdString());
std::string bsfn = boost::filesystem::path(path_to_model_file.toStdString()).stem().string();
QString name = QString::fromStdString(bsfn);

if (numbering) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,7 @@
#include <map>
#include <string>
#include <vector>
#include <cstdint>

namespace flatland_server
{
Expand Down
2 changes: 2 additions & 0 deletions flatland_server/include/flatland_server/types.h
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,8 @@
*/

#include <Box2D/Box2D.h>
#include <array>

//#include <geometry_msgs/msg/pose2_d.hpp>

#ifndef FLATLAND_SERVER_TYPES_H
Expand Down
9 changes: 7 additions & 2 deletions flatland_server/src/debug_visualization.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@
#include <rmw/qos_profiles.h>
#include <tf2/LinearMath/Quaternion.h>
#include <tf2/convert.h>
#include <tf2_geometry_msgs/tf2_geometry_msgs.h>
#include <tf2_geometry_msgs/tf2_geometry_msgs.hpp>

#include <map>
#include <rclcpp/rclcpp.hpp>
Expand Down Expand Up @@ -237,7 +237,12 @@ void DebugVisualization::Publish(const Timekeeper & timekeeper)

for (auto & topic : topics_) {
if (!topic.second.needs_publishing) {
continue;
if (topic.second.markers.markers.size() == 0) continue;
// publish if there's content, but only every 2s
auto delta = timekeeper.GetSimTime().seconds() - rclcpp::Time(topic.second.markers.markers[0].header.stamp).seconds();
if (delta < 2.0) {
continue;
}
}

// since if empty markers are published rviz will continue to publish
Expand Down
4 changes: 2 additions & 2 deletions flatland_viz/include/flatland_viz/load_model_dialog.h
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@
#include <OGRE/OgreEntity.h>
#include <OGRE/OgreSceneManager.h>
#include <OGRE/OgreSceneNode.h>
#include <OGRE/OgreVector3.h>
#include <OGRE/Ogre.h>

#include <QCursor>
#include <QDialog>
Expand All @@ -65,7 +65,7 @@
#include <QString>
#include <QVBoxLayout>
#include <QWidget>
//#include <OgreVector3.h>
//#include <Ogre.h>

#include <boost/filesystem.hpp>
#include <rclcpp/rclcpp.hpp>
Expand Down
4 changes: 2 additions & 2 deletions flatland_viz/include/flatland_viz/spawn_model_tool.h
Original file line number Diff line number Diff line change
Expand Up @@ -51,13 +51,13 @@
#include <OGRE/OgreEntity.h>
#include <OGRE/OgreSceneManager.h>
#include <OGRE/OgreSceneNode.h>
#include <OGRE/OgreVector3.h>
#include <OGRE/Ogre.h>

#include <memory>
#include <rclcpp/rclcpp.hpp>
#include <rviz_common/tool.hpp>
#include <vector>
//#include <OgreVector3.h>
//#include <Ogre.h>

#include <flatland_server/yaml_reader.h>

Expand Down
6 changes: 3 additions & 3 deletions flatland_viz/src/load_model_dialog.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -50,8 +50,8 @@
#include <OGRE/OgreEntity.h>
#include <OGRE/OgreSceneManager.h>
#include <OGRE/OgreSceneNode.h>
#include <OGRE/OgreVector3.h>
//#include <OgreVector3.h>
#include <OGRE/Ogre.h>
//#include <Ogre.h>

#include <rviz_common/visualization_manager.h>

Expand Down Expand Up @@ -171,7 +171,7 @@ void LoadModelDialog::OkButtonClicked()

void LoadModelDialog::AddNumberAndUpdateName()
{
std::string bsfn = boost::filesystem::basename(path_to_model_file.toStdString());
std::string bsfn = boost::filesystem::path(path_to_model_file.toStdString()).stem().string();
QString name = QString::fromStdString(bsfn);

if (numbering) {
Expand Down
2 changes: 1 addition & 1 deletion flatland_viz/src/model_dialog.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -110,7 +110,7 @@ ModelDialog::ModelDialog(QWidget * parent) : QDialog(parent)
h2_layout->addWidget(n_edit);

// set the default name to the filename parsed using boost
std::string bsfn = boost::filesystem::basename(path_to_model_file.toStdString());
std::string bsfn = boost::filesystem::path(path_to_model_file.toStdString()).stem().string();
QString fn = QString::fromStdString(bsfn);
n_edit->setText(fn);

Expand Down

0 comments on commit adbd168

Please sign in to comment.