camera_frame does not exist.

asked 2017-11-28 02:32:58 -0500

Andrzej gravatar image

updated 2017-11-30 01:43:32 -0500

Hi, I am new in ROS and I'm going through the ROS-Industrial tutorial and I've stopped on exercise 4.0 http://ros-industrial.github.io/indus...

I get errors like below

  [ERROR] [1511855001.563918253]: Exception thrown while processing service call: "camera_frame" passed to lookupTransform argument source_frame does not exist. 
[ERROR] [1511855001.564382981]: Service call failed: service [/localize_part] responded with an error: "camera_frame" passed to lookupTransform argument source_frame does not exist. 
[ERROR] [1511855001.564592927]: Could not localize part

I verified frames with command:

rosrun tf view_frames

and it is true. There are many frames such as world, base_link, shoulder_link etc. but there is no camera_frame at all. My question is where I could make a mistake or How to add camera_frame to robot environment.


Update 29th Nov 2017 9:10

I found in fake_ar_publisher code method comment

// Given a marker w/ pose data, publish an RViz visualization
// You'll need to add a "Marker" visualizer in RVIZ AND define
// the "camera_frame" TF frame somewhere to see it.

so I added marker but I can see nothing and I don't know also how to add TF frame.


Update 30th Nov 2017 8:40

I found solution which works for me. Apart from Marker added Yesterday I also added camera_frame broadcaster.

#include <ros/ros.h>
#include <tf/transform_broadcaster.h>

void broadcastCameraPosition(tf::TransformBroadcaster &br,tf::Transform &transform) {
    transform.setOrigin(tf::Vector3(0.0, 0.0, 0.0));
    transform.setRotation(tf::Quaternion(0, 0, 0, 1));
    br.sendTransform(tf::StampedTransform(transform, ros::Time::now(), "world", "camera_frame"));
    ROS_INFO("Transform camera_frame sent.");
}

int main(int argc, char **argv) {
    ros::init(argc, argv, "camera_frame_node");
    ros::NodeHandle nh;

    tf::TransformBroadcaster br;
    tf::Transform transform;



    ros::Rate loop_rate(0.5);
    int count = 0;
    while (ros::ok()) {

        broadcastCameraPosition(br,transform);

        ros::spinOnce();
        loop_rate.sleep();
    }
}
edit retag flag offensive close merge delete

Comments

What command/s do you run? Is 4.0/src/myworkcell_support/launch/urdf.launch getting launched?

lucasw gravatar image lucasw  ( 2017-11-28 11:28:51 -0500 )edit

In the tutorial is written that I should run only:

roslaunch myworkcell_moveit_config myworkcell_planning_execution.launch
roslaunch myworkcell_support workcell.launch

I tried Your launcher also Your command but it doesn't help.

Andrzej gravatar image Andrzej  ( 2017-11-29 01:49:42 -0500 )edit