Skip to content
Snippets Groups Projects
Commit 6ea9669c authored by Johannes Mey's avatar Johannes Mey
Browse files

do not send the scene every ten seconds

parent 3f012a20
No related branches found
No related tags found
No related merge requests found
...@@ -60,14 +60,21 @@ int main(int argc, char **argv) ...@@ -60,14 +60,21 @@ int main(int argc, char **argv)
controller.loadScene(getPrivateParameter<std::string>("scene", ros::package::getPath("ccf_immersive_sorting") + controller.loadScene(getPrivateParameter<std::string>("scene", ros::package::getPath("ccf_immersive_sorting") +
"/config/config_scene_ceti-table-placeworld.json")); "/config/config_scene_ceti-table-placeworld.json"));
// TODO check if this is required (since loadScene already sends the scene)
ROS_INFO_STREAM("Sending initial scene after loading it.");
controller.sendScene();
std::optional<std::string> currentlyPickedBox{}; std::optional<std::string> currentlyPickedBox{};
ros::Subscriber sub = n.subscribe<std_msgs::Empty>("send_scene", 1000, [&controller]( ros::Subscriber sub = n.subscribe<std_msgs::Empty>("send_scene", 1000, [&controller](
const std_msgs::EmptyConstPtr &msg) const std_msgs::EmptyConstPtr &msg)
{ controller.sendScene(); }); {
ros::Timer timer = n.createTimer(ros::Duration(10), [&controller]( ROS_INFO_STREAM("Sending scene manually (triggered by a message to the 'send_scene' topic)");
const ros::TimerEvent &event) controller.sendScene();
{ controller.sendScene(); }); // send a scene every ten seconds });
//ros::Timer timer = n.createTimer(ros::Duration(10), [&controller](
// const ros::TimerEvent &event)
//{ controller.sendScene(); }); // send a scene every ten seconds
auto pick_place_callback = [&controller](const Command& command) auto pick_place_callback = [&controller](const Command& command)
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment