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

Paul Pavish's profile - activity

2023-03-25 06:37:01 -0500 received badge  Famous Question (source)
2022-05-27 02:27:29 -0500 commented answer process has died [pid 20978, exit code 255, cmd /opt/ros/melodic/lib/gazebo_ros/gzserver -e ode /home/aditya/catkin_ws/src/my_simulations/world/empty_world.world __name:=gazebo __log:=

Yes, this worked. Thanks

2021-11-01 14:06:48 -0500 received badge  Famous Question (source)
2021-11-01 14:06:48 -0500 received badge  Notable Question (source)
2021-09-10 07:52:40 -0500 received badge  Nice Question (source)
2021-06-28 13:03:24 -0500 received badge  Famous Question (source)
2021-06-28 13:03:24 -0500 received badge  Notable Question (source)
2021-05-19 05:04:55 -0500 received badge  Student (source)
2021-05-19 05:04:19 -0500 received badge  Famous Question (source)
2021-05-19 05:04:19 -0500 received badge  Notable Question (source)
2021-02-25 04:16:06 -0500 received badge  Famous Question (source)
2021-01-23 12:34:28 -0500 received badge  Popular Question (source)
2021-01-20 10:26:59 -0500 edited question rosserial_server socket.py : Received message with unrecognized topicId (125)

rosserial_server socket.py : Received message with unrecognized topicId (125) Hi there, I'm trying out the 'ESP8266Hello

2021-01-20 10:26:15 -0500 asked a question rosserial_server socket.py : Received message with unrecognized topicId (125)

rosserial_server socket.py : Received message with unrecognized topicId (125) Hi there, I'm trying out the 'ESP8266Hello

2021-01-10 06:53:52 -0500 received badge  Notable Question (source)
2021-01-08 03:31:08 -0500 marked best answer Unable to use functions from custom imported module

Hi there, I'm a novice experimenting on making and using custom modules (python) having functions that is required for my rosnode. I can do the same in normal python, but I am struggling with the import. After I added the python script in CMakeLists.xml as executable script(python) , import didn't show error. Edited CMakeLists.xml :

## Mark executable scripts (Python etc.) for installation
## in contrast to setup.py, you can choose the destination
   catkin_install_python(PROGRAMS
    src/cmdvel_adapterv1.0
    src/server.py
    DESTINATION ${CATKIN_PACKAGE_BIN_DESTINATION}
  )

But now, when I try to use any function of server.py from cmdvel_adapterv1.0 :

#!/usr/bin/env python3
import server
import rospy
from std_msgs.msg import String


def callback(data):

    ---------


def function():

    port = 8081
    s = server.init_server(port)
   ----
    sub = rospy.Subscriber('cmdvel_socket_stream', String, callback)
    rospy.spin()



if __name__ == '__main__':

    try:
        rospy.init_node('cmdvel_adapter_v1_0')
        function()

    except rospy.ROSInterruptException:
        pass

in my rosnode, I get error -

    s = server.init_server(port)
AttributeError: module 'server' has no attribute 'init_server'

This is the Server.py module :-

import os
import socket

def dow():
    print("its accessing")


def get_ip():

    ip = socket.gethostname()
    return ip


def init_server(port):

    host = get_ip()
    server = socket.socket()
    server.bind((host,port))
    print('binded to ' + str(host) +':' + str(port))
    return server

What am I doing wrong here? This method worked outside ros, why not in ros. Help me.

Thanks in advance Paul Pavish

2021-01-08 03:31:01 -0500 received badge  Popular Question (source)
2021-01-07 00:38:13 -0500 edited answer Unable to use functions from custom imported module

Hi there, I found a solution here : https://roboticsbackend.com/ros-import-python-module-from-another-package/ edit :

2021-01-06 12:20:17 -0500 commented question Unable to use functions from custom imported module

Thankyou @mgruhler and @gvdhoom , With your keyword suggestions I was able to find a solution. Again, thanks for your re

2021-01-06 12:18:33 -0500 answered a question Unable to use functions from custom imported module

Hi there, I found a solution here : https://roboticsbackend.com/ros-import-python-module-from-another-package/ Tried i

2021-01-06 12:18:33 -0500 received badge  Rapid Responder (source)
2021-01-06 08:26:06 -0500 received badge  Enthusiast
2021-01-05 08:03:30 -0500 answered a question error pickling_unable to pickle : attribution look up failed

I found a way around this. Instead of Pickling a list of classes, I just stored them list of lists of values, without

2021-01-05 07:58:50 -0500 received badge  Popular Question (source)
2021-01-05 07:55:56 -0500 commented question Unable to use functions from custom imported module

@mgruhler, Hi there, thanks for the response. I updated the question with your suggested edits with important parts of m

2021-01-05 07:52:15 -0500 edited question Unable to use functions from custom imported module

Unable to use functions from custom imported module Hi there, I'm a novice experimenting on making and using custom mod

2021-01-05 07:49:40 -0500 edited question Unable to use functions from custom imported module

Unable to use functions from custom imported module Hi there, I'm a novice experimenting on making and using custom mod

2021-01-05 07:49:40 -0500 received badge  Editor (source)
2021-01-05 02:47:46 -0500 asked a question Unable to use functions from custom imported module

Unable to use functions from custom imported module Hi there, I'm a novice experimenting on making and using custom mod

2020-12-21 02:39:46 -0500 received badge  Notable Question (source)
2020-11-16 19:58:21 -0500 edited question error pickling_unable to pickle : attribution look up failed

error pickling_unable to pickle : attribution look up failed This a node for a new experiment that I'm doing and it coll

2020-11-16 12:58:03 -0500 asked a question error pickling_unable to pickle : attribution look up failed

error pickling_unable to pickle : attribution look up failed This a node for a new experiment that I'm doing and it coll

2020-11-13 07:34:01 -0500 received badge  Popular Question (source)
2020-11-11 10:31:19 -0500 answered a question Unable to install ROS TurtleBOT - Unable to locate package

Only TURTLEBOT3 is supported in ROS1(NOETIC) in Ubuntu Focal. https://emanual.robotis.com/docs/en/platform/turtlebot3/p

2020-11-11 10:31:18 -0500 commented answer Unable to install ROS TurtleBOT - Unable to locate package

Yes your right @chfritz. That was really helpful.

2020-11-11 09:30:55 -0500 received badge  Rapid Responder (source)
2020-11-11 09:13:56 -0500 marked best answer Unable to install ROS TurtleBOT - Unable to locate package

My OS : Distributor ID: Ubuntu Description: Ubuntu 20.04.1 LTS Release: 20.04 Codename: focal

My ROS

/rosdistro: noetic
/rosversion: 1.15.8

When I try to intall turtlebot packages using this

$ sudo apt-get install ros-indigo-turtlebot ros-indigo-turtlebot-apps ros-indigo-turtlebot-interactions ros-indigo-turtlebot-simulator ros-indigo-kobuki-ftdi ros-indigo-rocon-remocon ros-indigo-rocon-qt-library ros-indigo-ar-track-alvar-msgs

I get this Error :

Reading package lists... Done
Building dependency tree       
Reading state information... Done
E: Unable to locate package ros-indigo-turtlebot
E: Unable to locate package ros-indigo-turtlebot-apps
E: Unable to locate package ros-indigo-turtlebot-interactions
E: Unable to locate package ros-indigo-turtlebot-simulator
E: Unable to locate package ros-indigo-kobuki-ftdi
E: Unable to locate package ros-indigo-rocon-remocon
E: Unable to locate package ros-indigo-rocon-qt-library
E: Unable to locate package ros-indigo-ar-track-alvar-msgs

Even if I change the distro to kinetic or noetic , that still produces the same error messages with given distro name.

Why is this happening? Kindly help ASAP.

2020-11-10 12:36:05 -0500 asked a question Unable to install ROS TurtleBOT - Unable to locate package

Unable to install ROS TurtleBOT - Unable to locate package My OS : Distributor ID: Ubuntu Description: Ubuntu 20.04.1

2020-11-10 11:50:30 -0500 marked best answer Tutlesim GO2GOAL python code error : TypeError: unsupported operand type(s) for -: 'str' and 'float'

I tried the following code from Turtlesim tutorial (GO TO GOAL):

import rospy
from geometry_msgs.msg import Twist
from turtlesim.msg import Pose
from math import pow, atan2, sqrt



class TurtleBot:


    def __init__(self):

        rospy.init_node('turtlebot_controller', anonymous=True)
        self.velocity_publisher = rospy.Publisher('/turtle1/cmd_vel',Twist, queue_size=10)
        self.pose_subscriber = rospy.Subscriber('/turtle1/pose',Pose, self.update_pose)
        self.pose = Pose()
        self.rate = rospy.Rate(10)


    def update_pose(self,data):

        self.pose = data
        self.pose.x = round(self.pose.x, 4)
        self.pose.y = round(self.pose.y, 4)


    def euclidean_distance(self, goal_pose):

            return sqrt(pow((goal_pose.x - self.pose.x), 2) + pow((goal_pose.y - self.pose.y), 2))

    def linear_vel(self, goal_pose, constant = 1.5):

        return constant * self.euclidean_distance(goal_pose)


    def steering_angle(self, goal_pose):

        return atan2(goal_pose.y - self.pose.y, goal_pose.x - self.pose.x)


    def angular_vel(self, goal_pose, constant = 6):

        return constant * (self.steering_angle(goal_pose) - self.pose.theta)


    def move2goal(self):

        goal_pose = Pose()

        goal_pose.x = input("Set your x goal: ")
        goal_pose.y = input("Set your y goal: ")

        distance_tolerance = input("Set your tolerance: ")

        vel_msg = Twist()

        while self.euclidean_distance(goal_pose) >= distance_tolerance:

            vel_msg.linear.x = self.linear_vel(goal_pose)
            vel_msg.linear.y = 0
            vel_msg.linear.z = 0

            vel_msg.angular.x = 0
            vel_msg.angular.y = 0
            vel_msg.angular.z = self.angular_vel(goal_pose)

            self.velocity_publisher.publish(vel_msg)

            self.rate.sleep()

        vel_msg.linear.x = 0
        vel_msg.linear.z = 0
        self.velocity_publisher.publish(vel_msg)

        rospy.spin()


if __name__ == '__main__':

    try:
        x = TurtleBot()
        x.move2goal()

    except rospy.ROSInterruptException:
        pass

When i run it, it asks for value of x, value of y and then value of tolerance. But after entering tolerance it shows this error:

Traceback (most recent call last):
  File "/home/paul_pavish/draw_arm/devel/lib/turtle_control/turtle_control_node.py", line 15, in <module>
    exec(compile(fh.read(), python_script, 'exec'), context)
  File "/home/paul_pavish/draw_arm/src/turtle_control/turtle_control_node.py", line 82, in <module>
    x.move2goal()
  File "/home/paul_pavish/draw_arm/src/turtle_control/turtle_control_node.py", line 57, in move2goal
    while self.euclidean_distance(goal_pose) >= distance_tolerance:
  File "/home/paul_pavish/draw_arm/src/turtle_control/turtle_control_node.py", line 29, in euclidean_distance
    return sqrt(pow((goal_pose.x - self.pose.x), 2) + pow((goal_pose.y - self.pose.y), 2))
TypeError: unsupported operand type(s) for -: 'str' and 'float'

I assume that the goal_pose = Pose() didn't do it's part. If yes, then that means that import from a different module from turtlesim.msg import Pose didn't work. I tried simple Publisher & Subscriber (it worked) and Turtlesim_teleop_key(it also worked) along with some other customisations on Publisher & Subscriber (worked). Then whats happening here ???

Any suggestions on how to fix this TypeError ? I tried converting ever pose related object/variable to float , and it seems working fine then, but that's not the answer for long run, . Need Help ASAP.

Thanks in advance

Paul Pavish

2020-11-10 11:50:30 -0500 received badge  Scholar (source)
2020-11-10 11:49:41 -0500 received badge  Popular Question (source)
2020-11-04 11:08:46 -0500 commented answer Tutlesim GO2GOAL python code error : TypeError: unsupported operand type(s) for -: 'str' and 'float'

Thanks @skpro19, Yes it did work . But then what happened to the goal_pose=Pose() , why it didn't work? or if this is th

2020-11-04 01:36:29 -0500 received badge  Supporter (source)
2020-11-03 14:50:25 -0500 asked a question Tutlesim GO2GOAL python code error : TypeError: unsupported operand type(s) for -: 'str' and 'float'

Tutlesim GO2GOAL python code error : TypeError: unsupported operand type(s) for -: 'str' and 'float' I tried the followi