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

mhyde64's profile - activity

2021-12-03 11:55:41 -0500 received badge  Famous Question (source)
2021-08-20 11:19:31 -0500 received badge  Famous Question (source)
2021-08-04 06:17:25 -0500 commented question VirtualBox issues with USB-CAM and IMAGE-VIEW

Try it on a raspberry pi instead

2020-08-12 19:24:49 -0500 received badge  Notable Question (source)
2020-05-29 04:55:51 -0500 received badge  Famous Question (source)
2020-04-11 21:37:12 -0500 received badge  Famous Question (source)
2020-03-29 21:40:03 -0500 received badge  Notable Question (source)
2020-01-24 08:25:52 -0500 received badge  Notable Question (source)
2020-01-21 15:26:01 -0500 answered a question turtlesim tutorial "Go to Goal"

I believe if you look in the move2goal function the while loop condition should be the get_distance function: while get

2020-01-21 15:12:04 -0500 commented question How to publish two different messages at a time.

I agree with tryan, build a custom msg that holds data for both sub messages.

2020-01-14 15:40:29 -0500 received badge  Famous Question (source)
2020-01-14 14:45:35 -0500 received badge  Popular Question (source)
2020-01-14 02:06:28 -0500 received badge  Popular Question (source)
2020-01-13 17:26:29 -0500 answered a question Service Server and Client not working when launch by launch file

The problem was in : def client(self): ''' Client Implementation ''' req = False

2020-01-13 17:26:29 -0500 received badge  Rapid Responder (source)
2020-01-13 17:24:16 -0500 marked best answer Service Server and Client not working when launch by launch file

Hello all.

I am using a pandas data frame to format instructions and the data frame is hosted in a service server. I then have a client that is imported into a position supervising node. The client is a member of the position supervisor class which obviously will pull then next instruction on command.

If I run the parameter setup scripts and then rosrun each of these nodes then everything works as expected. However, I built a launch file and now every time the client is triggered to pull an instruction I get an error saying that the client is receiving a null response from the server.

Error:

[ERROR] [1578864176.167369]: Error processing request: local variable 'resp' referenced before assignment
['Traceback (most recent call last):\n', '  File "/opt/ros/melodic/lib/python2.7/dist-packages/rospy/impl/tcpros_service.py", line 629, in _handle_request\n    response = convert_return_to_response(self.handler(request), self.response_class)\n', '  File "/home/mhyde/arm_cws/src/arm_data_frame/src/nodes/dataFrameServer.py", line 66, in handleRequest\n    return resp\n', "UnboundLocalError: local variable 'resp' referenced before assignment\n"]
[ERROR] [1578864176.177881]: bad callback: <bound method positionSupervisor.arduinoStateCallback of <__main__.positionSupervisor object at 0x7fbb19878650>>
Traceback (most recent call last):
  File "/opt/ros/melodic/lib/python2.7/dist-packages/rospy/topics.py", line 750, in _invoke_callback
    cb(msg)
  File "/home/mhyde/arm_cws/src/position_supervisor/src/nodes/positionSupervisor.py", line 99, in arduinoStateCallback
    self.pullInstruction()
  File "/home/mhyde/arm_cws/src/position_supervisor/src/nodes/positionSupervisor.py", line 52, in pullInstruction
    self.instruction = self.instructionClient.client()
  File "/home/mhyde/arm_cws/src/arm_data_frame/src/arm_data_frame/dataFrameClient.py", line 52, in client
    return coor.motionType, coor.xCoor, coor.yCoor, coor.zCoor, coor.velFac, coor.accFac
AttributeError: 'NoneType' object has no attribute 'motionType'

Again, if I rosrun the dataFrameServer and the positionSupervisor and then manually publish to /arduinoState then everything works perfectly. I only get this error if I launch the dataFrame and Supervisor in a launch file.

Launch File:

<launch>
    <node name="dataFrameServer" pkg="arm_data_frame" type="dataFrameServer.py" />
    <node name="positionSupervisorParams" pkg="position_supervisor" type="positionSupervisorParams.py" />
    <node name="positionSupervisor" pkg="position_supervisor" type="positionSupervisor.py" />
</launch>

I did try removing nodes from the launch file and it appears the issue is coming from including the position supervisor in the launch file. When I remove it, run the launch file, and then rosrun the positionSupervisor then everything works well.

Below is the code for everything involved. I don't think the param files are casuing the issues.

Server:

#!/home/mhyde/vEnvs/rosPy/bin/python

'''
ROS Service - Server:

Feeds Coors from the CSV File to
the Data Handler upon service request.

Implements a Pandas DataFrame to contain
Coor information as well as actuator
and motion commands.
'''

import rospy
from arm_msgs.srv import instructionPass, \
    instructionPassResponse
from pandas import DataFrame, read_csv


class server(object):
    '''
    Coor Distributor

    topic =  /instructionPass
    node  =  /instructionPassServer
    '''

    def __init__(self, filePath):
        self.roboRoutine = DataFrame(read_csv(filePath, sep=","))
        self.index = 0
        self.instructionCount = 0

    def countInstructions(self):
        '''
        Counts the amount of Coors
        in routine
        '''
        self.instructionCount = self.roboRoutine ...
(more)
2020-01-13 17:24:16 -0500 received badge  Scholar (source)
2020-01-12 20:16:27 -0500 commented answer Service Server and Client not working when launch by launch file

Actually, here's something I realized. The error persists regardless of if I open the dataFrame with a launch file or

2020-01-12 20:06:06 -0500 commented answer Service Server and Client not working when launch by launch file

Actually, here's something I realized. The error persists regardless of if I open the dataFrame with a launch file or

2020-01-12 20:05:45 -0500 commented answer Service Server and Client not working when launch by launch file

Actually, here's something I realized. The error persists regardless of if I open the dataFrame with a launch file or

2020-01-12 19:43:43 -0500 commented answer Service Server and Client not working when launch by launch file

That is a good point. I have a few exceptions that I need to work into this program still. Let me play around with you

2020-01-12 15:31:13 -0500 asked a question Service Server and Client not working when launch by launch file

Service Server and Client not working when launch by launch file Hello all. I am using a pandas data frame to format in

2019-11-23 08:48:35 -0500 received badge  Popular Question (source)
2019-11-21 21:32:33 -0500 commented answer Custom Action Messages in ROSSerial Arduino

Thank you. I'll have to explore compiling C code from the workspace to the arduino.

2019-11-21 21:31:32 -0500 received badge  Supporter (source)
2019-11-20 19:30:11 -0500 asked a question Custom Action Messages in ROSSerial Arduino

Custom Action Messages in ROSSerial Arduino I am trying to run an action server on my arduino to control 4 stepper motor

2019-11-19 05:44:29 -0500 asked a question Including Publisher/Subscriber/NodeHandle without "ros.h"

Including Publisher/Subscriber/NodeHandle without "ros.h" I have a simple questions but can't seem to find any info. I

2019-11-18 07:32:55 -0500 received badge  Notable Question (source)
2019-11-13 20:31:46 -0500 received badge  Popular Question (source)
2019-11-10 17:02:18 -0500 asked a question VirtualBox issues with USB-CAM and IMAGE-VIEW

VirtualBox issues with USB-CAM and IMAGE-VIEW Hello, I am currently practicing opencv with ROS. I run it in various VMs

2019-10-25 09:39:53 -0500 received badge  Notable Question (source)
2019-10-11 14:40:20 -0500 received badge  Enthusiast
2019-10-07 18:22:18 -0500 received badge  Popular Question (source)
2019-10-07 07:07:40 -0500 commented question Publish when Subscribers have finished their loop.

Yes that is correct and you are right that it is problematic. It is working as a temporary fix for now while I work out

2019-10-05 21:07:30 -0500 asked a question Dependencies Issue when Installing Melodic on ARM64

Dependencies Issue when Installing Melodic on ARM64 I am trying to setup ROS Melodic on Ubuntu 18.04 on an ARM64 process

2019-10-04 14:20:54 -0500 commented question Publish when Subscribers have finished their loop.

I found a solution. Since my motors will all move at the RPM that will provide max torque and all of my angles are det

2019-10-04 10:23:27 -0500 commented question Publish when Subscribers have finished their loop.

"Have you tried to make your subscribers publish on a topic like /finished that the original publisher could subscribe t

2019-10-04 08:04:16 -0500 asked a question Publish when Subscribers have finished their loop.

Publish when Subscribers have finished their loop. I have a ros build that is working quite well. I take a DataFrame of