Skip to content

Commit

Permalink
Fix the absolute RPY Publisher to improve logging
Browse files Browse the repository at this point in the history
Related to auviitkgp#70

Signed-off-by: Siddharth Kannan <[email protected]>
  • Loading branch information
icyflame committed Sep 26, 2015
1 parent ac3924a commit 63df1f3
Showing 1 changed file with 19 additions and 3 deletions.
22 changes: 19 additions & 3 deletions control_system_stack/absolute_rpy_publisher/src/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@

import roslib;roslib.load_manifest('absolute_rpy_publisher')
import rospy
import sys
import time

from resources import topicHeader
Expand All @@ -31,6 +32,14 @@
from kraken_msgs.msg._imuData import imuData
from kraken_msgs.msg._absoluteRPY import absoluteRPY

verbose_flag = False
for i in sys.argv:

if i == '--verbose' or i == '--debug':

verbose_flag = True
break

# print topicHeader.SENSOR_IMU
# print topicHeader.ABSOLUTE_RPY

Expand All @@ -57,16 +66,23 @@ def imuCallback(imu):
abrpy.pitch = pitch
abrpy.yaw = yaw

print roll, pitch, yaw
rospy.logdebug('Roll: %s, Pitch: %s, Yaw: %s', roll, pitch, yaw)

absolute_rpy_publisher.publish(abrpy)
absolute_rpy_publisher.publish(abrpy)

# Store this in a message and publish it

if verbose_flag:

rospy.init_node('absolute_rpy_publisher', log_level=rospy.DEBUG)

else:

rospy.init_node('absolute_rpy_publisher')

absolute_rpy_publisher = rospy.Publisher(name=topicHeader.ABSOLUTE_RPY, data_class=absoluteRPY, queue_size=10)

rospy.Subscriber(name=topicHeader.SENSOR_IMU, data_class=imuData, callback=imuCallback)

rospy.init_node('absolute_roll_pitch_yaw_publisher')

rospy.spin()

0 comments on commit 63df1f3

Please sign in to comment.