21 #include <asr_ism_visualizations/record_visualizer_rviz.hpp> 22 #include <asr_ism_visualizations/ObjectModelVisualizerRVIZ.hpp> 25 #include <ISM/common_type/Tracks.hpp> 26 #include <ISM/common_type/VoteSpecifier.hpp> 27 #include <ISM/utility/TableHelper.hpp> 28 #include <ISM/utility/Util.hpp> 35 std::string db_filename;
36 std::string base_frame;
37 std::string scene_name;
38 std::string visualization_topic;
41 ISM::TableHelperPtr table_helper = ISM::TableHelperPtr(
new ISM::TableHelper(db_filename));
42 if(!table_helper->recordDataExists())
44 ISM::printRed(
"The database \"" + db_filename +
"\" doesn't contain any recordings!\n");
48 std::vector<ISM::ObjectSetPtr> recordedObjectSets;
50 ISM::RecordedPatternPtr recordedPattern = table_helper->getRecordedPattern(scene_name);
51 if (recordedPattern ==
nullptr)
53 ISM::printRed(
"No pattern in the database, with the name: " + scene_name +
"\n");
57 recordedObjectSets = recordedPattern->objectSets;
65 ISM::printGreen(
"Generate and publish record marker!\n");
75 void getNodeParameters(std::string& db_filename,std::string& base_frame, std::string& scene_name, std::string& visualization_topic)
87 if (!
nh_.
getParam(
"visualization_topic", visualization_topic)) {
88 visualization_topic =
"";
103 for (
auto obj : track->objects)
121 ISM::printGreen(
"Publish record marker!\n");
143 int main(
int argc,
char** argv)
150 delete record_viewer;
unsigned int number_of_subscriber_
ROSCPP_DECL void init(int &argc, char **argv, const std::string &name, uint32_t options=0)
ISM::TracksPtr recorded_object_tracks_
std::vector< ISM::ObjectPtr > recorded_objects_
ROSCPP_DECL void spin(Spinner &spinner)
void initRecordedObjects()
Timer createTimer(Rate r, Handler h, Obj o, bool oneshot=false, bool autostart=true) const
int main(int argc, char **argv)
Publisher advertise(const std::string &topic, uint32_t queue_size, bool latch=false)
void refreshVisualization(const ros::TimerEvent &e)
uint32_t getNumSubscribers() const
#define ROS_INFO_STREAM(args)
ros::Publisher visualization_publisher_
VIZ::RecordVisualizerRVIZ * record_visualizer_
bool getParam(const std::string &key, std::string &s) const
VIZ::ObjectModelVisualizerRVIZ * object_model_visualizer_
void getNodeParameters(std::string &db_filename, std::string &base_frame, std::string &scene_name, std::string &visualization_topic)