Ask Your Question

rosnovice12's profile - activity

2020-02-26 10:26:05 -0500 received badge  Nice Question (source)
2018-09-19 12:01:47 -0500 received badge  Famous Question (source)
2018-03-20 10:37:13 -0500 received badge  Notable Question (source)
2017-03-26 02:30:37 -0500 received badge  Popular Question (source)
2017-02-23 16:57:13 -0500 commented question pcl::fromROSMsg slow after Update

I had the same problem. The slowdown seems to be from displaying the pointcloud using the PCLVisualizer. Once I comment out the visualization process, the application does not loose speed.

2017-02-22 10:37:22 -0500 received badge  Student (source)
2017-02-22 09:42:24 -0500 asked a question dynamic_reconfigure callback function not called

I am using a simple dynamic_reconfigure server with a callback. The callback runs once when I launch the node but does not run after that when I change parameters using rqt. I have run the command rosrun dynamic_reconfigure dynparam list but I do not see any of the parameters that I use.

I am using to following code to start the server and callback:

 dynamic_reconfigure::Server<stereo_drivers::ExtrinsicsConfig> server;
 dynamic_reconfigure::Server<stereo_drivers::ExtrinsicsConfig>::CallbackType f;
 f = boost::bind(&extrinsicsCallback, _1, _2);
 server.setCallback(f);

Another issue is also that if I move the above code to the end of my main function, it does not seem to run even on the launch time. The following is my main function:

 int main(int argc, char* argv[])
 {
  //Ros initializations.
  ros::init(argc, argv, nodeName.str());
  //ros::NodeHandle n[numPorts];
  std::shared_ptr<ros::NodeHandle> nhPtr;
  nhPtr = std::make_shared<ros::NodeHandle>();

  std::shared_ptr<camera_info_manager::CameraInfoManager> cameraInfoManager;
  cameraInfoManager = std::make_shared<camera_info_manager::CameraInfoManager>(*nhPtr.get(), cameraName.str());     

 ///==================   Works here (only once at launch time) ========================
  dynamic_reconfigure::Server<stereo_drivers::ExtrinsicsConfig> server;
  dynamic_reconfigure::Server<stereo_drivers::ExtrinsicsConfig>::CallbackType f;
  f = boost::bind(&extrinsicsCallback, _1, _2);
  server.setCallback(f);
 ///========================================================================

  std::string calibPath;
  nhPtr->getParam(ros::this_node::getName()+"/calib_path", calibPath);
  if(!cameraInfoManager->loadCameraInfo(calibPath))
  {
      ROS_INFO("Camera info could not be loaded.");
  }       

  std::shared_ptr<image_transport::ImageTransport> it =
      std::make_shared<image_transport::ImageTransport>(*nhPtr.get());
  std::shared_ptr<image_transport::CameraPublisher> stereoPub = 
      std::make_shared<image_transport::CameraPublisher>
     //(it->advertiseCamera(ros::this_node::getNamespace()+"/image_raw", 10));
     (it->advertiseCamera("image_raw", 5));
  std::shared_ptr<ros::Publisher> timestampPublisher =
     std::make_shared<ros::Publisher>(nhPtr.get()->advertise<std_msgs::Int32MultiArray>("timestamp", 1));

  signal(SIGINT, stopSignalHandler);

  ImageBuilder<720, 487, 10> imageBuilder(stereoPub, cameraInfoManager, timestampPublisher);
  imageBuilder.buildImages();        

  ///================== Does not get invoked at all ===============================
  //dynamic_reconfigure::Server<stereo_drivers::ExtrinsicsConfig> server;
  //dynamic_reconfigure::Server<stereo_drivers::ExtrinsicsConfig>::CallbackType f;
  //f = boost::bind(&extrinsicsCallback, _1, _2);
  //server.setCallback(f);
  ///===================================================================

 ros::spin();
}

Hoping to get some help on this problem. Thanks