Servers by jDrones

Has anyone gotten Rover to work with ROS?


(Dan Pollock) #1

Looking for anyone that has actually gotten rover to work with ROS. By that I mean using the cmd_vel stream from the ROS navigation stack to interact with the cube. I’ve tried the pre-built packages built all the packages myself every combination you can think of. Using rqt robot steering and topic monitor I can see when I make a change in throttle or steering all the correct ROS messages are being sent and received but nothing changes on the traces from the servo outputs on the cube. This rover is also set up to run on a straight ROS stack. And it works just fine doing so. Can’t seem to find any examples or docs on how to do this. Which leads me to believe it just doesn’t work or works poorly enough that people just don’t use it. In setpoint_velocity.cpp I would expect to see something that fed values to RCOut. Instead it calls set_position_target_local_ned. Maybe it happens there I haven’t found that piece of code yet. Really doesn’t matter how it gets there the fact remains that nothing happens when you advance the throttle using setpoint_velocity with ROS. In fact I find generally linux support is also poor. Try to compile ardupilot firmware from the instructions in the wiki. Doesn’t work. In fact the only machine that does work with the instructions is windows. Why does mavlink come back with unknown command when you issue rosrun mavros mavsys mode -c GUIDED ? The command works it does go into guided mode at least that is what you see when you monitor /mavros/state So why the warning message. There are more that pop up. Depends on how its feeling I guess each start up can be very different. Even rebooting the machine between tries so its not something being left in memory or roscore that is getting messed up. Same thing happens on the Joule and nvidia boards. Joule TX1 and TX2 have been tested. So having spent considerable time on this now I’d really like to know if it actually works before I spend any more time on it.


(Khancyr) #2

Wooooo, many questions Dan ! Try to use Enter or shift+Enter to give some air between sentence ^^
So, about ROS and Rover, I maybe one of the few that use and try this combination. I will try to make you a video monday!
About linux support, I surprised that you found windows ways more easy, unless you got an old or exotic linux distribution … all tests are made on ubuntu, so at least on that type of linux it is working !

I don’t remember having a problem with mavros mavsys mode -c GUIDED but I rarely use that, so I will check that. Sometimes mavros print false warning like the RC_CHANNEL stuff …


(Dan Pollock) #3

Ubuntu 16.04 on a nvidia TX1 get hung up with you run the install-preqreqs script. Can’t import setuptools. They import just fine in python. There was some other issue trying to do it on my macbook. The rest of my rover works fine with just a ROS stack doing all the work. Well using the ros robot steering panel in rqt. My zed is fried so I have to figure out how to get the reslsense in there in its place as well but I’d be satisfied just to see the wheels turn with this ros pixhawk combination. What happened to pwm_type? It seems to have disappeared.


(Dude) #4

Khancyr hoping to see this work. Dan has gotten further than I have. I’m​ spinning my wheels with Pixhawk 2.1cube. Really just commented to show support for your videos. APM Rover ROS feels left behind so much that I now loathe anything that flys pixhawk they seem to have great times but not me…


(gmorph) #5

I’ve never tried ROS so I can’t help.

Thanks, Grant.


(Khancyr) #6

can you raise an issue on github with picture or copy past of what you get in the terminal ? or just here ? I don’t have a TX1, but with the error I can look at a solution and maybe other already got solution for TX1

About using the robot steering or setpoint_velocity, you need for now :

The pwm_type was just a temporary modification for MakeFaire show. It will come in master in the next weeks!

About ROS in general, I feel like a one man army. I think only me and Randy report ROS usage, so it is difficult to have a good overview of what really work, in what limit, and what doesn’t work … Raise issues or post on discuss if things aren’t working with ROS!


(Dan Pollock) #7

I managed to get it working finally. But did notice one thing that I think needs to be fixed. When you bring up mavros and look at the topics the setpoint_velocity topic isn’t there. So you can’t use the rqt robot throttle panel to send it commands. I think it doesn’t know the message type is the reason it can’t talk to mavros. When you enter the /mavros/setpoint_velocity/cmd_vel as the topic the throttle control uses it fails to do anything. However if you modify the mavsetp script to send multiple messages to avoid the timeout it works just fine. That probably cost me at least a week since I thought it would work. When you publish to any of the other setpoint plug-ins you see the result. I’ve been looking at the different plugins trying to figure out how to set it up properly but its been 20yr since i wrote any code so its slow going. Which version of APMRover has the patches for Nick’s motors in it? I need to get that set up for him. Missing the parameter to set the hz for the pwm in the version I have now. I didn’t realize there were so few of this type of set up out there. Videos of copters using the interface lead you to believe it will work just the same for a rover. Now that I know the situation I must apologize for being so cranky about it. Khancyr if you need the use of a rover for testing util you have your own we could set up teamviewer and you could use mine. I have more than one tx1 so I could set one up for your testing and just swap them when you need to use it. Wouldn’t be any trouble. Wouldn’t impact me as I always have more than one thing going at a time so I can switch over to one of those projects while you are testing.


(Dan Pollock) #8

Klu_o When you realize how few people are actually trying to use this its no surprise its a bit hard to set up and use. And with few people banging on it there is no way to force the errors to the surface so they can be taken care of. The thing that needs to happen is for someone to get one of these fully working and let the rest of the world know about it. Then you will generate some user base and rover will catch up to plane and copter. I was trying to make this work for MakerFaire. I hate to come up short it really bugs me. So my frustration level was already maxed out. I’ve been a very vocal supporter of putting ROS on these machines so when I couldn’t make it work it really bothered me that way as well. Had I known there were so few examples of it out there I wouldn’t have been so quick to say its all messed up and doesn’t work.


(gmorph) #9

I haven’t seen anyone use ROS and Plane. Only Copter.

Thanks, Grant.


(Dan Pollock) #10

New rover firmware is out new motor control lib. Looks good Thanks Randy and Pierre.


(Khancyr) #11

Thanks! Still a lot to do, but rover is gaining in capabilties !


(Dan Pollock) #12

Wish I hadn’t quit coding so long ago. Its so different now. I don’t recognize a lot of it. Limited time to work on stuff so I do things that don’t require a lot of research or study beforehand. Memory is so bad if I don’t get it done in a day or so and have to put it down its like starting over when I pick it back up. Hopefully that will go away with the medicine changes. If it were anyone else they would just go watch the telly in a rocker but I’m too stubborn. I just want to watch my rover go down the road autonomously anyone that helps me get to that place I have much respect for and thank them for their efforts. I’ve put all my efforts into learning ROS. Stripped a pinion one one of the motors the sweep died and the ZED hasn’t gotten here yet. So I’m dead in the water right now. Boring week. But should have it all back together by Wed. Then I can test the new firmware. I have a complete ROS stack for the rover with gmapping hector slam and soon cartographer as mapping options. Rafaello Bonghi’s code for panther robot. My rover is wired up so I can run it with that code or pull the roboteq driver and use the cube. And really running with the cube doesn’t require a motor driver once the rest of the stack is generating cmd_vel messages. So looking forward to getting the broken stuff fixed and getting that worked out. I think the best path for me to use to get it all working. And it has other advantages. Say a school group. Get a chassis put the cube in then part of the team has a working chassis to use while they develop software for the rest of the project. Natural steps towards full autonomous operation doing it this way IMO. Thought I might have to write something to make sure mavlink setpoint plugins were getting the messages often enough but the nav stack is putting them out at a rate which should make that unnecessary. Just need to start all that part of the system before firing up mavlink and mavros I’m thinking. That could be done in the upstart files. My goal was to create an autonomous rover with current tech using off the shelf parts and open source software without having to write anything except launch and config files. So far so good. Its looking like I’ll be able to do it.


(Dan Pollock) #13

Still can’t get this to work with a pixhawk. I have SITL on the same machine in the robot. Works fine with that. But using the same mavros mavlink pymavlink software it will not send out anything but 1500 across the board on the topic rc/out. Topic mavros/setpoint_velocity/cmd_vel_unstamped I’m seeing the changes produced by moving the throttle and steering sliders but never anything out of rc/out. Acts like its not arming or the timeout is activating. Used gs to arm used mavros mavsys and mavros mavsafety to arm and change mode. Has anyone else tried this with the actual hardware and not just on a simulator? Made sure the rover parameters are the same for the sim and the actual hardware. Using the latest rover build in the cube. This sounds like behavior that I’ve read about when the safety 50ms timer times out. Is there a way to tie that to the safety switch so it doesn’t go into effect until the computer and software are up and running and you hit the switch? Or is there a way to turn that timer off for debugging purposes?


(Dan Pollock) #14

Ok its working now. Had an older version of pymavlink from previous working on this. Uninstalled all the python stuff reinstalled it build mavros with instructions on the github page and its all working now. Saw a lot of messages about not being able to find the xml validation libraries. Can’t find how to fix that is it critical? Also a message FCU doesn’t support AUTOPILOT_VERSION. Is this something to be worried about?


(Khancyr) #15

Nice that you get it works! I haven’t retest it since the recent changes in rover but it shouldn’t impact this part of the rover.

Otherwise you to update pymavlink, you can use sudo pip2 install -U pymavlink
About xml validation, I think that is a missing depenciy for pymavlink but not a big deal.
“FCU doesn’t support AUTOPILOT_VERSION” is a bug in mavros, no worries !


(Dan Pollock) #16

yea I had trouble trying to build pymavlink but after I installed it with pip it all worked. However I did notice this.

Everything is at zero but the values from r/c out aren’t what they should be. Any way to tweak this to zero everything out? So next step is to lace this into the rest of the stack. It puts out cmd_vel but not sure if its unstamped. Does it respond to cmd_vel as well as cmd_vel_unstamped? Also did a rostopic -n1 /diagnostics and the key system status is critical when the radio is off. Doesn’t seem to impact anything though. Only problem is its too hot to test anything outside during the day. 105deg here today. Still have some issues running the ZED camera on a headless TX1. Found a hdmi eliminator dongle but its still missing something as it doesn’t fire up the Xserver session yet. Read some posts about people having to fake the EID value it should get from the monitor. The line in X.conf that they used to recommend for this is in the file now so it should work. Working on that next I can use waypoints or RQT throttle/steering panel to test SLAM. Just need those iMU readings the rest is working already. Finally get to work on the stuff I built all this to play with. Pretty sure things will go much smoother now. I’m using 3.2 beta 2 like you were running in that video you made. Could the values not being 1500 at zero throttle and steering have anything to do with the channel min and max? I haven’t changed those to 1000 2000 yet.


(Khancyr) #17

hum, the rc_out should be at 0 if you send cmv_vel_unstamped at 0. Did you check that your topic publishers weren’t sending anything ?
The velocity controler is the same that the one use in normal GUIDED or in AUTO, so if it works in those mode, the behaviour should be the same, or we get an error.
Current master got some little bug on guided currently, like be spammed of message “Target destination reached” (or something close!)

It will respond to cmd_vel and cmd_vel_unstamped, only the mavlink timestamp change ! It is pretty annoying that we can’t reverse the listener ! cmd_vel should be twist and not twistStamped … And that will be easier to use ROS nav stack


(Dan Pollock) #18

Is that a mavlink constraint? Yea I’ve seen the target reached messages. Doesn’t guided mode actually work as a series of waypoints?


(Dan Pollock) #19

https://youtu.be/zE17nnpy1Bk Just running in open loop mode so not as smooth as it should be. I’ll put it in closed loop mode and fine tune the pids next. Sure am happy to see this. Thanks for getting the firmware tightened up. https://youtu.be/zE17nnpy1Bk


(Dan Pollock) #20

Cant find the MOT_PWM_TYPE or the other MOT parameters have they gone away? I’m running 3.2 beta 2