how to modify ratslam's experience map node to subscribe to another topic?

asked 2019-10-23 19:58:39 -0600

sunt40 gravatar image

updated 2019-10-23 20:14:37 -0600

if (!ros::isInitialized()) { ros::init(argc, argv, "RatSLAMExperienceMap"); } ros::NodeHandle node;

ratslam::ExperienceMap * em = new ratslam::ExperienceMap(ratslam_settings);

pub_em = node.advertise<ratslam_ros::topologicalmap>(topic_root + "/ExperienceMap/Map", 1); pub_em_markers = node.advertise<visualization_msgs::marker>(topic_root + "/ExperienceMap/MapMarker", 1);

pub_pose = node.advertise<geometry_msgs::posestamped>(topic_root + "/ExperienceMap/RobotPose", 1);

pub_goal_path = node.advertise<nav_msgs::path>(topic_root + "/ExperienceMap/PathToGoal", 1);

ros::Subscriber sub_odometry = node.subscribe<nav_msgs::odometry>(topic_root + "/odom", 0, boost::bind(odo_callback, _1, em), ros::VoidConstPtr(), ros::TransportHints().tcpNoDelay()); ros::Subscriber sub_action = node.subscribe<ratslam_ros::topologicalaction>(topic_root + "/PoseCell/TopologicalAction", 0, boost::bind(action_callback, _1, em), ros::VoidConstPtr(), ros::TransportHints().tcpNoDelay());

ros::Subscriber sub_goal = node.subscribe<geometry_msgs::posestamped>(topic_root + "/ExperienceMap/SetGoalPose", 0, boost::bind(set_goal_pose_callback, _1, em), ros::VoidConstPtr(), ros::TransportHints().tcpNoDelay());

I'd like to subscribe to another topic here, like color. how to do ?

edit retag flag offensive close merge delete