Bluerov_ros_playground launch files clarification

Operation Clarification:

When does one use user_mav.launch vs bluerov2_node.launch? It would appear that bluerov2_node.launch eventually calls the user node,

see node.py: rospy.init_node(‘user_node’, log_level=rospy.DEBUG)

but in that case what is the user_mav.launch for?

Im using SITL along side of the bluerov_ros_playground.

  • bluerov2_node: provides abstraction for BlueROV2
  • user_mav: runs user code or script.

So do I need to run both at once? One of them dies if I attempt to do this.

You should run one or the other, not both. Can you explain what you want to accomplish ?

Im just trying to figure out for what situation I should use each launch file for.

Hi @rdehart,

Sorry if I was not clear, the bluerov2_node, is like any other ROS node program, provides ROS abstraction for the ROV with topics to subscribe and publish. The user script is just a simple python example of how to program and control the ROV without the ROS node.

“The user script is just a simple python example of how to program and control the ROV without the ROS node.”

Hmmm, I think user.py has ROS code in it.

There is a difference between ROS and BlueROV ROS node, ROS node is a node abstraction for the robot, like BlueROV2/topics, I would recommend you to read and follow the ROS tutorial. The user script uses ROS mavros abstraction to communicate with the vehicle, without dealing and using the BlueROV2 ROS node abstraction.

Thanks! I thought you have to run both to get everything working.

However, now when Im running SITL and just the BlueROV node, I cant make the Gazebo model move either by publishing to /BlueRov2/setpoint_velocity/cmd_vel or /BlueRov2/rc_channel4/set_pwm. I could do it with the user script.

I think I answered the question to that one - in that it seems that the BlueRov2 node still needs mavros to be running to send the rc_override commands on to mavlink - at least in SITL.

Will it work without mavros when using the actual hardware?

Hi,

Both uses mavros since the BlueROV2 communicates via mavlink, for more information you can check mavros official documentation: http://wiki.ros.org/mavros

Alright, so I picked the bridge.py apart to get it to work, and discovered the following:

My system refused to take rc_override commands UNLESS the master is specified as updin:0.0.0.0:14550

Which begs some clarification:
What is the nuance in which address form to use? I have seen many variants

udp:192.168.2.1:14550 (I think this SHOULD work, but does not)
udp:127.0.0.1:14550 (I think this is for SITL)
tcp:192.168.2.1:14550 (unsure why this does not work)
udp://:14550@127.0.0.1:14549 (this REALLY confuses me, because it doesnt even have an address at the beginning and I cant find out what the @ sign means)

If you could clarify that would be great, or confirm if I just need to ask the Mavlink people.

Hi @rdehart,

If you have your ROV configured correctly it should work. What is your ROV ip address ?

This is not part of the code and I’m unsure where you got this mavlink connection string.

This is TCP, the entire communication is done via UDP.

As you can see in the XML, this is a mavros parameter, and to understand it better it’s necessary to read the mavros documentation: https://github.com/mavlink/mavros/blob/master/mavros/README.md

Thanks for the clarification. As far as udp:192.168.2.1:14550, my computer is set to that IP address and the sub definitely has 192.168.2.2 set because I can get into the companion website via 192.168.2.2:2700 and verified on the mavlink page.

It seems strange to me that mavlink requires you specify the address of the topside machine running pymavlink and not the address of the companion you want to talk to.