How can I correct the problem in a simple question 2 [closed]

asked 2018-05-30 21:22:59 -0500

Pujie gravatar image

I learnt rosignite in these days, I don't know how to correct the problems. Slogan of the question: Create a package that launches the code. Modify the code in order to print the odometry of the robot. 1. The odometry of the robot is published by the robot into the /odom topic. 2. You will need to figure out what message uses the /odom topic, and how the structure of this message is.

odom_subscriber.py import rospy from nav_msgs.msg import Odometry

def callback(msg): print msg.data

rospy.init_node('odom_sub_node') sub = rospy.Subscriber('/odom',Odometry,callback) rospy.spin()

odom_subscriber.launch <launch> <node pkg="exercise22" type="odom_subscriber.py" name="odom_sub_node" output="screen"> </node> </launch>

Problem: user:~$ roslaunch exercise_22 odom_subscriber.launch ... logging to /home/user/.ros/log/d040bc5e-6476-11e8-88f0-065a2c6c1cb0/roslaunch-ip-172-31-47-59-20167.log Checking log directory for disk usage. This may take awhile. Press Ctrl-C to interrupt Done checking log file disk usage. Usage is <1GB.

started roslaunch server http://10.8.0.1:37393/

SUMMARY

PARAMETERS * /rosdistro: kinetic * /rosversion: 1.12.12

NODES / odom_sub_node (exercise22/odom_subscriber.py)

ROS_MASTER_URI=http://10.8.0.1:11311

ERROR: cannot launch node of type [exercise22/odom_subscriber.py]: exercise22 ROS path [0]=/opt/ros/kinetic/share/ros ROS path [1]=/home/user/catkin_ws/src ROS path [2]=/home/simulations/public_sim_ws/src ROS path [3]=/opt/ros/kinetic/share No processes to monitor shutting down processing monitor... ... shutting down processing monitor complete

edit retag flag offensive reopen merge delete

Closed for the following reason Question does not follow our guidelines for questions. Please see: http://wiki.ros.org/Support for more details. by tfoote
close date 2019-02-21 18:33:56.484235

Comments

Wait, is this a learning exercise question?

achmad_fathoni gravatar image achmad_fathoni  ( 2018-05-30 22:13:53 -0500 )edit
1

Please use the "preformatted text" button (marked 101010) to format the output in your question so that it is readable.

ahendrix gravatar image ahendrix  ( 2018-05-30 22:42:17 -0500 )edit

Yes, it is in ros ignite exercise 2.2, but I can't configure the question up to now.

Pujie gravatar image Pujie  ( 2018-05-31 20:08:54 -0500 )edit

Sorry, I didn't know the meaning of 101010 button before.

Pujie gravatar image Pujie  ( 2018-05-31 20:10:51 -0500 )edit