Robotics StackExchange | Archived questions

get person position data from leg_detector

Hey everyone, im pretty new to Unix and the whole ROS ecosystem and im currently working on my bachelor thesis in trying to realise person following by a turtlebot 2. Im running ROS indigo. Right now im trying to get Position data of persons through the legdetector node (http://wiki.ros.org/legdetector).

The installation and setup is done and now im trying to get the data out of the "peopletrackermeasurements"-topic. Unfortunately Im not getting any feedback through "rostopic echo" and im also not really sure how to adress the variables coming from this topic in my own node (im coding in python). According to the documentation files in ROS wiki i imagine it works like this:

I setup a package through catkin and created my .py-file in the src-Folder. Eventually i want to take my distance to person x and calculate speed commands (angular and linear) for my robot to follow the person but for now i just want extract the raw position data to start working with it. Here is my code:

import rospy
import math

from geometry_msgs.msg import Twist
from geometry_msgs.msg import Point
from people_msgs.msg import PositionMeasurementArray
from people_msgs.msg import PositionMeasurement

rospy.init_node('turtlebot_follower_leg_detector')

pub = rospy.Publisher ('cmd_vel_mux/input/teleop', Twist)

def callback(msg):
   print 'person 1:', msg.people[0].pos.x
sub = rospy.Subscriber('people_tracker_measurements', PositionMeasurementArray, callback)

My node causes no errors when starting but just doesnt print anything so im quite sure im not grabbing the right value (or any value) in my print-line. "rostopic echo peopletrackermeasurements" also doesnt echo anything...

Maybe im doing a very basic python mistake here but as my coding skills are pretty limited, i unfortunately cant fix this myself.

EDIT: I just realisied that trying to to rostopic echo the topic produces the quite known error "Cannot load message class for [people_msgs/PositionMeasurementArray]. Are your messages built?" but unlike many other users i get the following error when using "rosmsg show PositionMeasurementArray": "Could not find msg 'PositionMeasurement'".

I downloaded the source of the people-package from https://github.com/wg-perception/people, put it in my catkinws/src folder and uses catkinmake. Still the message type seems to be unknown for my ROS

Some help is much appreciated!

Best regards, stoevi

Asked by stoevi on 2017-06-19 06:19:49 UTC

Comments

Answers

okay so I found the answer myself, maybe it will help someone who got a similar problem:

I downloaded the leg_detector package as part of the whole people-package and split them afterwards because i thought i only need the leg_detector. big mistake by me, I shouldn't have switched up the directories. after I copypasted just the whole dir into my catkin_ws and executed catkin_make, i needed to again source my workspace in every shell (the permanent solution somehow doesnt work right now) before i can use the people-messages.

the syntax in my code for getting position seems to be alright, I know get my data and can work with it :)

Asked by stoevi on 2017-06-23 02:48:53 UTC

Comments