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

Azeem's profile - activity

2023-02-23 09:50:18 -0500 marked best answer How to access the value from the subscriber callback

i want to use the variable value from subscriber callback function on other function.

 #! /usr/bin/env python3
import rospy
from sensor_msgs.msg import LaserScan


class path_planning:
    def __init__(self): 
        print("initalizing publisher and subscriber")
        rospy.init_node("path_plan", anonymous=True)
        self.sub = rospy.Subscriber(
            "/ebot/laser/scan", LaserScan, self.callback)
        rospy.spin()
        rospy.sleep(10)

def use(self):
    self.gg = 2
    return self.gg

def callback(self,msg):
    print("getting into callback")
    self.part_1 = msg.ranges[:145]
    self.part_2 = msg.ranges[145:289]
    self.part_3 = msg.ranges[289:433]
    self.part_4 = msg.ranges[433:577]
        self.part_5 = msg.ranges[577:]
        # print(self.part_1)

        # print(self.part_1)
        # values = splitter(self.part_1)



if __name__ =="__main__":
    path = path_planning()
    print(path.use())

i tried various ways still couldn't find one that works for me and also saw similar question on various forum. i dont know what am i doing wrong. can someone help me with that.

2022-12-04 14:49:56 -0500 received badge  Famous Question (source)
2022-09-26 01:03:40 -0500 commented question How to Fix drift in AMCL

@Mike Scheutzow, The pictures 7 and 8 are taken from plotjuggler and I think it should be from map -> base_link (I am

2022-09-26 00:32:59 -0500 commented question How to Fix drift in AMCL

@GeorgNo, Yes, I tried to change the values runtime but it didn't have much change. The only thing I noticed is if I use

2022-09-24 20:11:14 -0500 received badge  Famous Question (source)
2022-09-23 10:49:49 -0500 received badge  Notable Question (source)
2022-09-22 12:05:44 -0500 received badge  Popular Question (source)
2022-09-22 03:30:08 -0500 edited question How to Fix drift in AMCL

How to Fix drift in AMCL I am trying to use AMCL to localize my robot. I am converting 3D lidar data to 2D using Pointcl

2022-09-22 03:25:23 -0500 asked a question How to Fix drift in AMCL

How to Fix drift in AMCL I am trying to use AMCL to localize my robot. I am converting 3D lidar data to 2D using Pointcl

2022-08-24 07:16:29 -0500 received badge  Notable Question (source)
2022-07-27 05:21:47 -0500 received badge  Famous Question (source)
2022-07-02 02:47:47 -0500 commented answer Adding covariance matrix to ndt_pose.

Okay sure. By the way is the approach that I have currently taken is wrong?

2022-07-02 02:27:53 -0500 received badge  Popular Question (source)
2022-06-30 20:16:10 -0500 commented answer Adding covariance matrix to ndt_pose.

Okay, but in that case how will I generate dynamic covariance?. Bcoz if I calculate covariance while the vehicle is stat

2022-06-30 06:29:07 -0500 asked a question Adding covariance matrix to ndt_pose.

Adding covariance matrix to ndt_pose. I am trying to fuse the pose that I get from NDT with the pose that I generate fro

2022-05-30 15:55:10 -0500 received badge  Notable Question (source)
2022-05-23 08:57:35 -0500 received badge  Famous Question (source)
2022-05-23 08:57:35 -0500 received badge  Notable Question (source)
2022-05-12 02:51:28 -0500 received badge  Notable Question (source)
2022-03-06 18:45:08 -0500 received badge  Popular Question (source)
2022-01-30 22:10:37 -0500 commented question How to properly use the localization mode of slam_toolbox

Sorry, I was AFK for the past few days, @osliva I checked my CPU utilisation and it looks fine to me. It's utilisation

2022-01-27 03:41:47 -0500 asked a question How to properly use the localization mode of slam_toolbox

How to properly use the localization mode of slam_toolbox Hi, I am still a newbie in ROS and I came across slam_toolbox

2022-01-27 03:35:40 -0500 asked a question How to properly use the localization mode of slam_toolbox

How to properly use the localization mode of slam_toolbox Hi, I am still a newbie in ROS and I came across slam_toolbox

2021-11-11 20:54:47 -0500 received badge  Popular Question (source)
2021-11-11 08:42:50 -0500 asked a question How to access the value from subscriber callback function on other function.

How to access the value from subscriber callback function on other function. i want to use the variable value from subsc

2021-11-11 08:40:41 -0500 asked a question How to access the value from the subscriber callback

How to access the value from the subscriber callback i want to use the variable value from subscriber callback function

2021-06-26 00:13:10 -0500 received badge  Enthusiast
2021-06-22 08:37:10 -0500 received badge  Supporter (source)
2021-06-22 06:43:23 -0500 commented question Can someone please help me to identify as to where I went wrong in installing ROS melodic..

Thank you for your response and Yes I did @kscottz. Actually, I have figured what was wrong and solved it. The reason I

2021-06-20 07:59:26 -0500 received badge  Popular Question (source)
2021-06-16 23:34:50 -0500 asked a question Can someone please help me to identify as to where I went wrong in installing ROS melodic..

Can someone please help me to identify as to where I went wrong in installing ROS melodic.. Hi, I am a newbie trying to