Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

phidgets_high_speed_encoder: Failed to open device: Timed Out #147

Closed
teknetik opened this issue Jun 5, 2022 · 1 comment
Closed

phidgets_high_speed_encoder: Failed to open device: Timed Out #147

teknetik opened this issue Jun 5, 2022 · 1 comment

Comments

@teknetik
Copy link

teknetik commented Jun 5, 2022

I am struggling to get the high-speed encoder node working. I have the spatial 3/3/3 and it works great. I have tried hardcoding the serial to 641610 in the src too with no luck.

Phidgets Device:

PhidgetEncoder HighSpeed 4-Input
ID: 1047_2B

usb-device:

T: Bus=01 Lev=02 Prnt=02 Port=03 Cnt=01 Dev#= 19 Spd=12 MxCh= 0 D: Ver= 2.10 Cls=00(>ifc ) Sub=00 Prot=00 MxPS=64 #Cfgs= 1 P: Vendor=06c2 ProdID=004f Rev=02.00 S: Manufacturer=Phidgets Inc. S: Product=PhidgetEncoder HighSpeed 4-Input S: SerialNumber=641610 C: #Ifs= 1 Cfg#= 1 Atr=80 MxPwr=96mA I: If#=0x0 Alt= 0 #EPs= 1 Cls=ff(vend.) Sub=00 Prot=00 Driver=(none)

Ubuntu 20.04
Ros2 Foxy

libusb:

libusb-1.0-0 is already the newest version (2:1.0.23-2build1). libusb-1.0-0-dev is already the newest version (2:1.0.23-2build1).

Launch command:

`ros2 launch phidgets_high_speed_encoder high_speed_encoder-launch.py

[INFO] [launch]: All log files can be found below /home/teknetik/.ros/log/2022-06-05-19-10-39-102421-alice-888830
[INFO] [launch]: Default logging verbosity is set to INFO
[INFO] [component_container-1]: process started with pid [888865]
[component_container-1] [INFO] [1654452655.686973543] [phidget_container]: Load Library: /home/teknetik/scootbot/install/phidgets_high_speed_encoder/lib/libphidgets_high_speed_encoder.so
[component_container-1] [INFO] [1654452655.688421283] [phidget_container]: Found class: rclcpp_components::NodeFactoryTemplatephidgets::HighSpeedEncoderRosI
[component_container-1] [INFO] [1654452655.688436178] [phidget_container]: Instantiate class: rclcpp_components::NodeFactoryTemplatephidgets::HighSpeedEncoderRosI
[component_container-1] [INFO] [1654452655.691503622] [phidgets_high_speed_encoder]: Starting Phidgets Encoders
[component_container-1] [INFO] [1654452655.691837290] [phidgets_high_speed_encoder]: Connecting to Phidgets Encoders serial -1, hub port 0 ...
[component_container-1] [ERROR] [1654452656.692259456] [phidgets_high_speed_encoder]: Encoders: Failed to open device: Timed Out
[component_container-1] [ERROR] [1654452656.694243591] [phidget_container]: Component constructor threw an exception: Failed to open device: Timed Out
[ERROR] [launch_ros.actions.load_composable_nodes]: Failed to load node 'phidgets_high_speed_encoder' of type 'phidgets::HighSpeedEncoderRosI' in container '/phidget_container': Component constructor threw an exception: Failed to open device: Timed Out
^C[WARNING] [launch]: user interrupted with ctrl-c (SIGINT)
[component_container-1] [INFO] [1654452743.224424057] [rclcpp]: signal_handler(signal_value=2)
[INFO] [component_container-1]: process has finished cleanly [pid 888865]

`

Using example code from Phidgets for python I can see data from my device:

from Phidget22.Devices.Encoder import *
import time

def onPositionChange(self, positionChange, timeChange, indexTriggered):
    print("PositionChange: " + str(positionChange))
    print("TimeChange: " + str(timeChange))
    print("IndexTriggered: " + str(indexTriggered))
    print("getPosition: " + str(self.getPosition()))

def main():
	encoder0 = Encoder()
	encoder1 = Encoder()
	encoder2 = Encoder()
	encoder3 = Encoder()

	encoder0.setChannel(0)
	encoder1.setChannel(1)
	encoder2.setChannel(2)
	encoder3.setChannel(3)

	encoder0.setOnPositionChangeHandler(onPositionChange)
	encoder1.setOnPositionChangeHandler(onPositionChange)
	encoder2.setOnPositionChangeHandler(onPositionChange)
	encoder3.setOnPositionChangeHandler(onPositionChange)

	encoder0.openWaitForAttachment(5000)
	encoder1.openWaitForAttachment(5000)
	encoder2.openWaitForAttachment(5000)
	encoder3.openWaitForAttachment(5000)

	try:
		input("Press Enter to Stop\n")
	except (Exception, KeyboardInterrupt):
		pass

	encoder0.close()
	encoder1.close()
	encoder2.close()
	encoder3.close()

main()
@teknetik
Copy link
Author

teknetik commented Jun 5, 2022

USER ERROR:

ros2 launch phidgets_high_speed_encoder high_speed_encoder-launch.py _serial:=641610

@teknetik teknetik closed this as completed Jun 5, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant