ROS Resources: Documentation | Support | Discussion Forum | Index | Service Status | ros @ Robotics Stack Exchange
Ask Your Question

pennjamin's profile - activity

2022-04-28 11:13:07 -0500 answered a question pkg_resources.DistributionNotFound: The 'rospkg==1.2.3' distribution was not found and is required by the application

Hey there, I have the same problem on armhf Debian 10 for ROS2 Foxy. pip3 install rospkg tells me that the package is

2020-07-17 03:09:37 -0500 received badge  Famous Question (source)
2019-08-15 19:23:40 -0500 received badge  Notable Question (source)
2019-07-31 01:17:13 -0500 commented question Strange behavior/missing joints when using MoveIt to configure gripper

Hi there, I have the same problem. Did you by any chance find a solution? Also, could this be related to some sort of a

2019-07-31 00:04:24 -0500 received badge  Enthusiast
2019-07-17 19:18:09 -0500 received badge  Supporter (source)
2019-07-17 19:15:07 -0500 commented question external action server called with rosbridge without js

Hi, yes roslibpy now has this class roslibpy.actionlib.SimpleActionServer(...) here: https://roslibpy.readthedocs.io/e

2019-05-06 04:36:24 -0500 received badge  Popular Question (source)
2019-04-29 02:15:03 -0500 edited question external action server called with rosbridge without js

external action server called with rosbridge without js Hello there, TL;DR: Is it possible to set up an external action

2019-04-29 02:06:04 -0500 edited question external action server called with rosbridge without js

external action server called with rosbridge without http / js Hello there, TL;DR: Is it possible to set up an external

2019-04-29 02:05:41 -0500 edited question external action server called with rosbridge without js

external action server called with rosbridge without http / js Hello there, TL;DR: Is it possible to set up an external

2019-04-29 01:57:19 -0500 asked a question external action server called with rosbridge without js

external action server called with rosbridge without http / js Hello there, TL;DR: Is it possible to set up an external

2017-04-19 16:10:52 -0500 received badge  Notable Question (source)
2017-04-19 16:10:52 -0500 received badge  Famous Question (source)
2015-11-18 10:48:25 -0500 received badge  Teacher (source)
2015-11-18 10:48:25 -0500 received badge  Self-Learner (source)
2015-11-18 10:38:34 -0500 received badge  Popular Question (source)
2015-11-17 19:26:42 -0500 received badge  Editor (source)
2015-11-17 17:40:12 -0500 answered a question SetCameraInfo successfully called but no change in /camera_info topic

Thank you Dan Lazewatsky for the useful hints,

the srv.status_message returned "Error formatting camera_info for storage", so I checked the documentation of the ueye camera node.

It turned out, that the calibration file I was using doesn't match the formatting standard of the camera node. After using a default calibration file it worked.

For completeness I post the optimized code below:

#include <ros/ros.h>
#include <sensor_msgs/CameraInfo.h>
#include <sensor_msgs/SetCameraInfo.h>
#include <camera_calibration_parsers/parse.h>
using namespace std;

int main(int argc, char **argv)
{
  ros::init(argc, argv, "apply_camera_info");
  if (argc != 3)
  {
    ROS_INFO("usage: apply_camera_info <camera topic> <calibration file>");
    return 1;
  }

  ros::NodeHandle n;

  std::ostringstream ossSet;
  ossSet << argv[1] << "set_camera_info";
  std::string s = ossSet.str();
  ros::ServiceClient client = n.serviceClient<sensor_msgs::SetCameraInfo>(s);

  std::string camera_name = argv[1];
  std::string filename = argv[2];

  sensor_msgs::CameraInfo camera_info;
  camera_calibration_parsers::readCalibration(filename, camera_name, camera_info);

  sensor_msgs::SetCameraInfo srv;
  srv.request.camera_info = camera_info;

  if (client.call(srv))
  {
    if(srv.response.success)
    {
      std::ostringstream ossInf;
      ossInf << srv.request.camera_info;
      ROS_INFO("%s", ossInf.str().c_str());
      ROS_INFO("Calibration successfully applied.");
    }
    else
    {
      std::ostringstream ossStm;
      ossStm << srv.response.status_message;
      ROS_ERROR("%s", ossStm.str().c_str());
      return 1;
    }    
  }
  else
  {
    ROS_ERROR("Failed to call service camera/set_camera_info");
    return 1;
  }

  return 0;
}
2015-11-17 13:11:50 -0500 asked a question SetCameraInfo successfully called but no change in /camera_info topic

Hello there,

I am trying to write a little C++ package to apply custom made calibration files to my indigo system using the following code (inspired by this thread):

#include <ros/ros.h>
#include <image_transport/image_transport.h>
#include <sensor_msgs/Image.h>
#include <sensor_msgs/CameraInfo.h>
#include <sensor_msgs/SetCameraInfo.h>
#include <camera_calibration_parsers/parse.h>
#include <cstdlib>
#include <vector>
using namespace std;

int main(int argc, char **argv)
{
  ros::init(argc, argv, "apply_camera_info");
  if (argc != 3)
  {
    ROS_INFO("usage: apply_camera_info <camera topic> <calibration file>");
    return 1;
  }

  ros::NodeHandle n;

  std::ostringstream oss;
  oss << argv[1] << "set_camera_info";
  std::string s = oss.str();

  ros::ServiceClient client = n.serviceClient<sensor_msgs::SetCameraInfo>(s);

  std::string camera_name = argv[1];
  std::string filename = argv[2];    
  sensor_msgs::CameraInfo camera_info;

  camera_calibration_parsers::readCalibration(filename, camera_name, camera_info);      

  sensor_msgs::SetCameraInfo srv;
  srv.request.camera_info = camera_info;


  if (client.call(srv))
  {
    std::ostringstream sss;
    sss << srv.request.camera_info;
    ROS_INFO("%s", sss.str().c_str());
    ROS_INFO("Calibration successfully applied.");
  }
  else
  {
    ROS_ERROR("Failed to call service <camera>/set_camera_info");
    return 1;
  }

  return 0;
}

Actually the code seems to work fine. ROS_INFO returns the correct camera_info values after running the command. However, when I run rostopic echo /camera_info in another tab, I still get the old values. So no update is actually taking place.

Would you have any suggestions for me? Btw: I am using a ueye camera.

Thanks Ben