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

Imu_attitude_to_tf_node Error: 'command not found'

asked 2020-02-26 09:56:11 -0500

SamH gravatar image

updated 2020-02-26 14:26:56 -0500

gvdhoorn gravatar image

I am attempting to convert data from the Pixhawk IMU to a transform broadcast using the "hector_imu_attitude_to_tf" node from the Hector SLAM repository (found at: link text ) However, when I run the file using:

rosrun hector_imu_attitude_to_tf imu_attitude_to_tf_node.cpp

I get the following error message, with "command not found" listed 5 times, as well as 2 other errors:

/hector_imu_attitude_to_tf/src/imu_attitude_to_tf_node.cpp: line 5: std::string: command not found
/home/luengr/a_ws/src/hector_slam/hector_imu_attitude_to_tf/src/imu_attitude_to_tf_node.cpp: line 6: std::string: command not found
/home/luengr/a_ws/src/hector_slam/hector_imu_attitude_to_tf/src/imu_attitude_to_tf_node.cpp: line 7: tf::TransformBroadcaster*: command not found
/home/luengr/a_ws/src/hector_slam/hector_imu_attitude_to_tf/src/imu_attitude_to_tf_node.cpp: line 8: tf::StampedTransform: command not found
/home/luengr/a_ws/src/hector_slam/hector_imu_attitude_to_tf/src/imu_attitude_to_tf_node.cpp: line 9: tf::Quaternion: command not found
/home/luengr/a_ws/src/hector_slam/hector_imu_attitude_to_tf/src/imu_attitude_to_tf_node.cpp: line 12: typedef: command not found
/home/luengr/a_ws/src/hector_slam/hector_imu_attitude_to_tf/src/imu_attitude_to_tf_node.cpp: line 13: syntax error near unexpected token `}'
/home/luengr/a_ws/src/hector_slam/hector_imu_attitude_to_tf/src/imu_attitude_to_tf_node.cpp: line 13: `  namespace tf { typedef btMatrix3x3 Matrix3x3; }'

It has been suggested to me that this is a dependencies issue, however i have used Rosdep to install all dependencies with no luck. Is there something I am not seeing? I assume it is something I have not set up properly as I assume the code from the Hector-SLAM repository is working fine. Many Thanks

edit retag flag offensive close merge delete

1 Answer

Sort by ยป oldest newest most voted
2

answered 2020-02-26 14:29:33 -0500

gvdhoorn gravatar image

However, when I run the file using:

rosrun hector_imu_attitude_to_tf imu_attitude_to_tf_node.cpp

you cannot directly execute .cpp files.

C++ is a compiled language, so you need to first build the package and only then can you start the node(s).

Did you run catkin_make (or catkin build) before trying to start anything?

edit flag offensive delete link more

Comments

That explains a lot! How do I build the package and start the node? I did run catkin_make, and also used "chmod +x imu_attitude_to_tf_node.cpp" to give the file execution rights.

SamH gravatar image SamH  ( 2020-02-27 08:24:10 -0500 )edit

These appear to be questions that would have been answered by the introductory tutorials. In short: cd to the root of your workspace and then run catkin_make (after having run source /opt/ros/kinetic/setup.bash).

and also used "chmod +x imu_attitude_to_tf_node.cpp" to give the file execution rights.

No. That's not how this works.

This is C++, not Python or a shell script.

gvdhoorn gravatar image gvdhoorn  ( 2020-02-27 13:29:58 -0500 )edit

I'm afraid I'm not familiar with running C++ files so thank you for your explanation. I have now resolved the issue. Thanks again

SamH gravatar image SamH  ( 2020-02-28 08:26:45 -0500 )edit

Question Tools

1 follower

Stats

Asked: 2020-02-26 09:56:11 -0500

Seen: 317 times

Last updated: Feb 26 '20