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

chusikowski's profile - activity

2019-07-12 12:17:46 -0500 received badge  Famous Question (source)
2019-07-12 01:28:23 -0500 received badge  Notable Question (source)
2019-07-12 01:28:23 -0500 received badge  Popular Question (source)
2019-07-10 11:02:20 -0500 asked a question How to publish pose in new frame?

How to publish pose in new frame? Hi all, Thanks a lot for reading my question. I am currently running a simulator in p

2019-07-10 11:02:19 -0500 asked a question How to publish pose in new frame?

How to publish pose in new frame? Hi all, Thanks a lot for reading my question. I am currently running a simulator in p

2019-06-19 12:11:51 -0500 edited question How can I move a Frame to its initial position after sequence (edited)

How can I move a Frame to its initial position after sequence Dear all, Thanks a lot for reading my question. I am curr

2019-06-19 12:04:46 -0500 edited question How can I move a Frame to its initial position after sequence (edited)

How can I move a Frame to its initial position after sequence Dear all, Thanks a lot for reading my question. I am curr

2019-06-18 07:14:37 -0500 edited question How can I move a Frame to its initial position after sequence (edited)

How can I move a Frame to its initial position after sequence Dear all, Thanks a lot for reading my question. I am curr

2019-06-18 06:12:17 -0500 edited question How can I move a Frame to its initial position after sequence (edited)

How can I move a Frame to its initial position after sequence Dear all, Thanks a lot for reading my question. I am curr

2019-06-18 06:12:14 -0500 edited question How can I move a Frame to its initial position after sequence (edited)

How can I move a Frame to its initial position after sequence Dear all, Thanks a lot for reading my question. I am curr

2019-06-18 05:22:05 -0500 edited question How can I move a Frame to its initial position after sequence (edited)

How can I move a Frame to its initial position Dear all, Thanks a lot for reading my question. I am currently running a

2019-06-18 05:21:53 -0500 edited question How can I move a Frame to its initial position after sequence (edited)

How can I move a Frame to its initial position Dear all, Thanks a lot for reading my question. I am currently running a

2019-06-18 05:21:11 -0500 edited question How can I move a Frame to its initial position after sequence (edited)

How can I move a Frame to its initial position Dear all, Thanks a lot for reading my question. I am currently running a

2019-06-18 05:17:46 -0500 asked a question How can I move a Frame to its initial position after sequence (edited)

How can I move a Frame to its initial position Dear all, Thanks a lot for reading my question. I am currently running a

2019-06-06 04:32:58 -0500 received badge  Famous Question (source)
2019-06-06 04:32:58 -0500 received badge  Notable Question (source)
2019-05-31 12:17:33 -0500 received badge  Popular Question (source)
2019-05-30 04:12:34 -0500 received badge  Enthusiast
2019-05-29 03:37:59 -0500 commented question How to reset odometry pose

@stevemacenski thanks a lot for your answer, I will look into this and get back to you.

2019-05-28 10:12:54 -0500 received badge  Organizer (source)
2019-05-28 10:01:39 -0500 asked a question How to reset odometry pose

How to reset odometry pose Hello all, I have a python code (see below) that publishes short commands in the form of a t

2019-05-06 12:21:00 -0500 edited question How to get publisher and callback to talk to one another (python)

How to get publisher and callback to talk to one another (python) Hello, I am trying to get my code (python)to publish

2019-05-06 12:18:35 -0500 marked best answer How to get publisher and callback to talk to one another (python)

Hello,

I am trying to get my code (python)to publish a simple sequence in form of a Twist message, and then get the timestamp of when those messages are executed with the callback function. This is somehow not working, can someone please help? Thank you in advance.

The code:

#!/usr/bin/env python
import rospy
from geometry_msgs.msg import Twist, TransformStamped

Times = []
x_pos = []

class CommandEvaluatorNode(object):

    def __init__(self):
        self.cmd_vel_pub = rospy.Publisher('cmd_vel', Twist, queue_size = 10) 

    def run_command_tests(self):
        r = rospy.Rate(0.8)
        twist_sequence = [[1, 1, 1], [2, 2 , 3],[3, 3, 4]]
        rospy.loginfo("Publishing first sequence")
        for cmd in twist_sequence:
            r.sleep()
            msg = Twist()
            msg.linear.x = cmd[0]
            msg.linear.y =cmd[1]
            msg.angular.z = cmd[2]
            x_pos.append(cmd[0])
            self.cmd_vel_pub.publish(msg)

    def callback(self, msg):
        l = rospy.Rate(0.8)
        l.sleep()
        time = msg.header.stamp.secs + msg.header.stamp.nsecs * 1e-9
        Times.append(time)

    def ros_init(self):
        rospy.init_node('cmd_evaluator', anonymous=True)
        rospy.Subscriber("tf", TransformStamped, self.callback) 

if __name__ == '__main__':
    rosnode = CommandEvaluatorNode()
    rosnode.ros_init()
    rosnode.run_command_tests()
2019-05-06 12:18:35 -0500 received badge  Scholar (source)
2019-05-06 12:18:34 -0500 commented answer How to get publisher and callback to talk to one another (python)

Thank you for your help. After some playing around with the code and implementing a delay with rospy.Rate() I managed to

2019-05-06 09:33:53 -0500 commented question How to get publisher and callback to talk to one another (python)

@kump , @rukie thank you for the input. I will have a look at this.

2019-05-05 12:59:12 -0500 received badge  Famous Question (source)
2019-05-05 10:38:13 -0500 edited question How to get publisher and callback to talk to one another (python)

How to get publisher and callback to talk to one another (python) Hello, I am trying to get my code (python)to publish

2019-05-05 10:37:58 -0500 edited question How to get publisher and callback to talk to one another (python)

How to get publisher and callback to talk to one another (python) Hello, I am trying to get my code (python)to publish

2019-05-04 04:58:09 -0500 commented question How to get publisher and callback to talk to one another (python)

Hi @rukie , @jayess thank you very much for your answers. I edited the code to showcase the full thing. The reason why

2019-05-04 04:18:08 -0500 edited question How to get publisher and callback to talk to one another (python)

How to get publisher and callback to talk to one another (python) Hello, I am trying to get my code (python)to publish

2019-05-04 04:18:08 -0500 received badge  Editor (source)
2019-05-01 19:01:46 -0500 received badge  Notable Question (source)
2019-05-01 12:53:24 -0500 edited question How to get publisher and callback to talk to one another (python)

How to get publisher and callback to talk to one another (python) Hello, I am trying to get my code (python)to publish

2019-05-01 12:43:19 -0500 received badge  Supporter (source)
2019-05-01 11:59:44 -0500 received badge  Popular Question (source)
2019-05-01 09:08:57 -0500 asked a question How to get publisher and callback to talk to one another (python)

How to get publisher and callback to talk to one another (python) Hello, I am trying to get my code (python)to publish