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

Unresolved refference "sensor_msgs", while making a script for subscribing to IMU data.

asked 2021-12-15 19:46:09 -0500

commando2239 gravatar image

updated 2021-12-16 09:57:41 -0500

Mike Scheutzow gravatar image

I am trying to write a subscriber node to subscribe to IMU data and created a package for the same. My package has the sensor_mags dependencies. Here is my package.xml

  <buildtool_depend>catkin</buildtool_depend>
  <build_depend>roscpp</build_depend>
  <build_depend>rospy</build_depend>
  <build_depend>sensor_msgs</build_depend>
  <build_depend>std_msgs</build_depend>
  <build_export_depend>roscpp</build_export_depend>
  <build_export_depend>rospy</build_export_depend>
  <build_export_depend>sensor_msgs</build_export_depend>
  <build_export_depend>std_msgs</build_export_depend>
  <exec_depend>roscpp</exec_depend>
  <exec_depend>rospy</exec_depend>
  <exec_depend>sensor_msgs</exec_depend>
  <exec_depend>std_msgs</exec_depend>

However, when I write the import statements, I get this error:

Import statement:

import rospy
from std_msgs.msg import String
from sensor_msgs.msg import Imu

Error:

Unresolved reference 'sensor_msgs'
Unresolved reference 'Imu'

I am using pycharm and I had similar issues with rospy however I can't remember how I resolved it.

And also when I run the same code in my terminal after running python 3, I do not get any error.

edit retag flag offensive close merge delete

1 Answer

Sort by ยป oldest newest most voted
0

answered 2021-12-16 09:56:46 -0500

Mike Scheutzow gravatar image

There are existing questions on this site about configuring pycharm e.g. #q347824 You can type pycharm into the search box at the top of this page to find them.

edit flag offensive delete link more

Question Tools

2 followers

Stats

Asked: 2021-12-15 19:46:09 -0500

Seen: 114 times

Last updated: Dec 16 '21