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

ros2 urg_node parameter file #79

Closed
edfang1 opened this issue Nov 7, 2020 · 6 comments · Fixed by #112
Closed

ros2 urg_node parameter file #79

edfang1 opened this issue Nov 7, 2020 · 6 comments · Fixed by #112
Labels

Comments

@edfang1
Copy link

edfang1 commented Nov 7, 2020

installed sudo apt install ros-foxy-urg-node.
ros2 run urg_node getID works fine and returns ID.
ros2 run urg_node urg_node_driver __params:=/opt/ros/foxy/share/urg_node/launch/urg_node_ethernet.yaml

returns can't find serial port 115200 /dev/cu.usbmodemxxxxx

I've set the ip address in the yaml file and it just doesent seem to be reading the paramtere file anywere. Any idea on why its not readin the parameter file and using the IP address of the hokuyo (since thats the model I have) ?

Tried to git clone and build, but colcon build comes out with a bunch of catkin (ros1) type of errors.

Thanks for any assistance. Apologies if this is an idiot request. I've read everything I could find and search upon. Thanks

urg_node_ethernet.yaml file :

urg_node:
  ros__parameters:
    angle_max: 3.14
    angle_min: -3.14
    ip_address: "192.168.1.68"
    ip_port: 10940
    serial_baud: 57600
    laser_frame_id: "laser"
    calibrate_time: false
    default_user_latency: 0.0
    diagnostics_tolerance: 0.05
    diagnostics_window_time: 5.0
    error_limit: 4
    get_detailed_status: false
    publish_intensity: false
    publish_multiecho: false
    cluster: 1
    skip: 0
@mikeferguson
Copy link
Member

ros2 run urg_node urg_node_driver __params:=/opt/ros/foxy/share/urg_node/launch/urg_node_ethernet.yaml

You'll have to post the yaml file if there is going to be any hope of debugging this

Tried to git clone and build, but colcon build comes out with a bunch of catkin (ros1) type of errors.

Have you checked out the right branch? This repo is used for both ROS1 and ROS2.

@edfang1
Copy link
Author

edfang1 commented Nov 7, 2020

Updated the original file. the orignal is run with urg_node being installed as a binary (apt install). I realized that I was pulling from the wrong branch last night as it dawned on me .. . lol. I'll try building it from source, but was wondering why the binary one wasnt able to take the param file and seemingly was ignoring it.

I've built the ros2 version (ros2-devel). sourceed it (. install/local_setup.bash). and then executed the following with the same yaml file (only thing changed from the default is the ip address definition).

ros2 run urg_node urg_node_driver __params:=/home/edf/ros2_ws/src/urg_node/launch/urg_node_ethernet.yaml
[ERROR] [1604762567.286880359] [urg_node]: Error connecting to Hokuyo: Could not open serial Hokuyo:
/dev/cu.usbmodem141101 @ 115200
could not open serial device.
[ERROR] [1604762567.287887545] [urg_node]: Error connecting to Hokuyo: Could not open serial Hokuyo:
/dev/cu.usbmodem141101 @ 115200

Obviously I can ping the Ip of the scanner. But it doesnt even seem to be going to the param file to pick up the IP network device and seems to be just defaulting to the usb device.

As another test, I changed the baud rate on all the yaml devices to 57600 just to see if it was taking the baud rate from the yaml files. And it still gives the same error above - so I think I must be passing the wrong parameter in for the yaml file as it just isnt taking any of them.

and finally, I populated the ip address (hard coded) in the urg_node.cpp file at the UrgNode section, rebuilt it and it works fine. ros2 topic echo /scan shows the data from the scanner. So the build obviously works, just that I cant seem to feed a parameter file in correctly. its probably an obvious thing I'm missing, I just dont know what it is. . lol

@mikeferguson
Copy link
Member

Ok - since we generate the node using rclcpp_components_register_node - can you try changing the node name to "urg_node_driver" in your yaml file? I think that ends up being the default node name (but I don't seem to have any example of loading from a yaml -- I've been putting the params directly into a launch file)

@edfang1
Copy link
Author

edfang1 commented Nov 8, 2020

tried changing the yaml file to urg_node_driver and its the same. Like its not even picking up the param file on the call.

I will eventually be doing it from a launch file, but right now just testing the new hoyuko with rviz - so that would be the first step. Not sure if its my reference or whether its just not picking up the param declaration on the command line.

@Kakcalu13
Copy link

tried changing the yaml file to urg_node_driver and its the same. Like its not even picking up the param file on the call.

I will eventually be doing it from a launch file, but right now just testing the new hoyuko with rviz - so that would be the first step. Not sure if its my reference or whether its just not picking up the param declaration on the command line.

Did you manage to get it fixed? If so, what was the solution?

@Kaetera
Copy link

Kaetera commented Apr 23, 2021

I encountered the same error with ROS2 Foxy on Ubuntu.
The run instructions provided in the Readme of the foxy/devel branch seem a bit out-of-date, the correct way to pass the YAML parameters file that worked for me and that is the recommended way in ROS2 was:

ros2 run urg_node urg_node_driver --ros-args --params-file src/test/urg_params.yaml

Else the YAML file is silently ignored and not IP was set.
This is the way according to ROS2 Foxy doc: https://docs.ros.org/en/foxy/Guides/Node-arguments.html#parameters

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants