Ask Your Question

murali1842's profile - activity

2021-10-12 14:32:17 -0500 asked a question I recorded RADAR data using SockectCAN and rosbag. I wanted to visualize in Rviz.

I recorded RADAR data using SockectCAN and rosbag. I wanted to visualize in Rviz. I recorded RADAR CAN data using Sockec

2020-08-16 09:52:51 -0500 received badge  Famous Question (source)
2020-08-16 09:52:51 -0500 received badge  Notable Question (source)
2020-04-06 05:15:15 -0500 received badge  Good Answer (source)
2020-01-20 01:29:39 -0500 received badge  Famous Question (source)
2019-09-17 15:12:53 -0500 received badge  Enthusiast
2019-08-01 11:24:17 -0500 received badge  Notable Question (source)
2019-08-01 11:24:17 -0500 received badge  Popular Question (source)
2019-06-07 07:05:00 -0500 received badge  Famous Question (source)
2019-06-07 07:05:00 -0500 received badge  Notable Question (source)
2019-05-15 10:45:06 -0500 received badge  Popular Question (source)
2019-05-14 04:00:39 -0500 received badge  Nice Answer (source)
2019-05-10 20:20:17 -0500 received badge  Famous Question (source)
2019-05-10 14:36:35 -0500 asked a question ROS debugging in VS code C++

ROS debugging in VS code C++ Is VS code is a good IDE for ROS development in C++? Anybody have an good cpp_properties,

2019-04-26 02:31:58 -0500 received badge  Popular Question (source)
2019-04-25 09:36:05 -0500 asked a question How to draw a square around the detected object in rviz in a 2d plane?

How to draw a square around the detected object in rviz in a 2d plane? I am using a radar to detect the obstacles. I nee

2018-12-03 17:07:57 -0500 commented answer How to run a ros publisher without a while loop?

Hey commands in python similar to rospy.Timer(duration , command)? @PeteBlackerThe3rd

2018-11-30 12:06:27 -0500 edited question Continuosly check for ROS master online in a Python program?

Continuosly check for ROS master online in a Python program? I would like to continuously Check for ROS master online in

2018-11-30 12:04:55 -0500 asked a question Continuosly check for ROS master online in a Python program?

Continuosly check for ROS master online in a Python program? I would like to continuously Check for ROS master online in

2018-11-28 14:29:28 -0500 received badge  Supporter (source)
2018-11-28 14:27:12 -0500 edited answer Best way to check if ROS is running

Python: Gives out a boolean if the master uri is online or not import rosgraph if rosgraph.is_master_online(): # Chec

2018-11-27 17:30:34 -0500 received badge  Famous Question (source)
2018-11-27 14:29:01 -0500 edited answer How to run a ros publisher without a while loop?

import rospy, numpy, threading, time from std_msgs.msg import Int32MultiArray class Simulat: def __init__(self):

2018-11-27 14:28:38 -0500 edited answer How to run a ros publisher without a while loop?

import rospy, numpy, threading, time from std_msgs.msg import Int32MultiArray class Simulat: def __init__(self):

2018-11-27 14:26:12 -0500 marked best answer How to run a ros publisher without a while loop?

I am writing tkinter python program for turning on and off the publisher. I need to turn on and off the publisher using a button. If am writing using while loop, the entire gui freezes, I am unable to operate anything. Please give me some suggestions.

dummy = Button(master, text="dummy", relief='groove', command=self.pub_values)
def pub_values(self):
    self.pub = rospy.Publisher('/gateway', Int32MultiArray, queue_size=10)
    rospy.init_node('talker_int', anonymous=True)
    rate = rospy.Rate(1)  # 10hz
    self.var = Int32MultiArray()
    self.var.data = []
    ls = self.extract_values()
    self.var.data = ls
    self.on = True
    while self.on == True:
        rospy.loginfo(self.var)
        self.pub.publish(self.var)
        rate.sleep()

UPDATE: New code after feedback

import rospy, numpy, threading, time
from std_msgs.msg import Int32MultiArray


if __name__ == '__main__':
    x = Simulat()
    try:
        x.t.start()
    except rospy.ROSInterruptException:
        pass

I need to stop or cancel and restart the above program from console. @PeteBlackerThe3rd

Update 2:

Final working code after suggestions

import rospy, numpy, threading, time 
from std_msgs.msg import Int32MultiArray


class Simulat:
    def __init__(self):
        rospy.init_node('talker_int', anonymous=True)        
        self.pub = rospy.Publisher('/gateway', Int32MultiArray, queue_size=10)
        self.rate = rospy.Rate(0.5)  # 10hz
        self.var = Int32MultiArray()
        self.var.data = []
        self.t = threading.Timer(2.0, self.talker_int)
        self.on = True

    def talker_int(self):
        rate = rospy.Rate(1) # 10hz
        var = Int32MultiArray()
        var.data = []
        ls = range(6000, 6041)
        #while not rospy.is_shutdown():
        while self.on == True:
            k = [x+1 for x in ls]
            var.data = k   #% rospy.get_time()
            rospy.loginfo(var)
            self.pub.publish(var)
            rate.sleep()
            ls = k

if __name__ == '__main__':
    x = Simulat()
    try:
        t = rospy.Timer(rospy.Duration(2), x.talker_int)
    except rospy.ROSInterruptException:
       pass
2018-11-27 14:26:12 -0500 received badge  Scholar (source)
2018-11-27 14:10:41 -0500 commented answer How to run a ros publisher without a while loop?

perfecto... I got it. IT is working. thanks a lot

2018-11-27 14:10:41 -0500 received badge  Commentator
2018-11-27 13:15:16 -0500 edited answer How to run a ros publisher without a while loop?

import rospy, numpy, threading, time from std_msgs.msg import Int32MultiArray class Simulat: def __init__(self):

2018-11-27 13:15:16 -0500 received badge  Editor (source)
2018-11-27 13:11:41 -0500 commented answer How to run a ros publisher without a while loop?

I need continuous publishing, when i need if self.on==True, i am getting only one time.

2018-11-27 13:10:33 -0500 answered a question How to run a ros publisher without a while loop?

import rospy, numpy, threading, time from std_msgs.msg import Int32MultiArray class Simulat: def __init__(self): r

2018-11-27 12:27:51 -0500 commented answer How to run a ros publisher without a while loop?

I need to stop or cancel and restart the above program from console. @PeteBlackerThe3rd

2018-11-27 12:26:13 -0500 answered a question How to run a ros publisher without a while loop?

import rospy, numpy, threading, time from std_msgs.msg import Int32MultiArray class Simulat: def __init__(self): ro

2018-11-27 12:08:52 -0500 commented answer How to run a ros publisher without a while loop?

I tried it worked. t = threading.Timer(1.0, self.pub_values) when self.on == True it is stopping when i make self.on

2018-11-27 11:59:09 -0500 commented answer How to run a ros publisher without a while loop?

I tried it worked. t = threading.Timer(1.0, self.pub) when self.on == True it is stopping when i make self.on=False.

2018-11-27 11:36:51 -0500 commented answer How to run a ros publisher without a while loop?

Thanks @PeteBlackerThe3rd. Let me try and see.

2018-11-27 11:31:43 -0500 received badge  Notable Question (source)
2018-11-27 09:20:17 -0500 edited question How to run a ros publisher without a while loop?

How to run a ros publisher without a while loop? I am writing tkinter python program for turning on and off the publishe

2018-11-27 08:42:03 -0500 commented answer How to run a ros publisher without a while loop?

Could you share some link with the above-mentioned description?

2018-11-27 06:41:11 -0500 received badge  Popular Question (source)
2018-11-26 17:09:59 -0500 asked a question How to run a ros publisher without a while loop?

How to run a ros publisher without a while loop? I am writing tkinter python program for turning on and off the publishe

2018-10-26 16:25:38 -0500 commented answer How to add ROS to path in VS Code?

Can you give me some suggestions please...

2018-10-26 16:25:20 -0500 commented answer How to add ROS to path in VS Code?

This may occur if the process's executable was changed after the process was started, such as when installing an update.

2018-10-26 16:25:06 -0500 commented answer How to add ROS to path in VS Code?

GDB failed with message: "/home/catkin_ws/src/beginner_tutorials/scripts/talker.cpp": not in executable format: File for

2018-10-26 16:23:57 -0500 commented answer How to add ROS to path in VS Code?

I am trying with simple talker.cpp program. I could not find a way to RUN it. I have followed all your steps. When I deb