PDA

View Full Version : Is there an RVIZ for dummies?



KurtEck
04-05-2016, 12:09 PM
Is there a simple RVIZ setup for Dummies :lol:

I start and stop trying to use RVIZ every several months and each time I do I forget most everything I learned the previous time, so was wondering if there is a cheat sheet out there that can help people to setup RVIZ.

In my current particular case I would like to setup to work with KevinO's hexapod_ros project, with a two computer setup. The PhantomX has an Odroid-XU4 on it that runs the hexapod code and some form of PC to run rviz.

From earlier notes from Renee (r3n33):
I launch the hexapod_ros code on the Odroid:
In my case I do:
roslaunch hexapod_bringup phantomx.launch

Note: the phantomx.launch is a copy of the hexapod_simple.launch where I substituted in to use the phantomx and DS3 as the defaults.

Also in the earlier notes was some stesp to start up jackd for sounds, but I skipping that for now as I have plugged in sound adapter yet.

On a remote machine, I see from old notes, edited slightly for changes in directory layout:


cd ~/catkin_ws
source devel/setup.sh
export ROS_MASTER_URI=http://<odroid_ip_address>:11311
roslaunch hexapod_bringup rviz.launch

I was getting several errors, which was reduced when I;

sudo apt-get install ros-indigo-rtabmap-ros

Next thing I am running into is in this current attempt, I thought I would try having the Linux PC, be virtual PC on my Windows 10 setup. So I have Ubuntu 14.04 installed in an Oracle VM VirtualBox. Things appear to run OK, except I am not sure I can get the networking stuff to work properly. That is in a terminal window in the VM: I can ping my Odroid and it works fine.
But on the Odroid, in the run of hexapod, I get messages like:

Couldn't find an AF_INET address for [kurt-VirtualBox]
If I do a ifconfig in the virtualbox I see:

[email protected]:~/catkin_ws/src/hexapod_ros/hexapod_bringup/launch$ ifconfig
eth0 Link encap:Ethernet HWaddr 08:00:27:48:21:6a
inet addr:10.0.2.15 Bcast:10.0.2.255 Mask:255.255.255.0
inet6 addr: fe80::a00:27ff:fe48:216a/64 Scope:Link


Edit: on both machines either need to have the IP addresses listed in /etc/hosts file or so far it looks like you can get away with having each ROS computer export their ROS_IP address with a command like:

export ROS_IP=`hostname -I`

Which I know is not in my normal: 192.168.2.xxx range

So first question, has anyone tried this and made it work? Or should I instead setup another machine just running Linux to run rviz?

Assuming I get this up and working, suggestions on how to use RVIZ to do specific tasks would be appreciated.

Example Suppose I would like to be able to ask the robot to walk forward some number of feet in a certain amount of time, can I do so and also then see what the robot actually did?

Thanks in advance
Kurt

tician
04-05-2016, 01:30 PM
It has been a while since I've used virtualbox, but I seem to remember it defaulting to using a dhcp server to create a virtual link between the OS instance's ethernet port (non-existent/virtual hardware port) and the host machine's hardware instead of letting the instance directly access the hardware. 10.0.2.x is simply the local subnet used by the dhcp server (10.42.0.x is the default for my xubuntu-12.04 when sharing a connection; routing wired ethernet connected machines through to netbook and its wifi internet connection). Not sure the specific implementation of the dhcp server will easily allow direct access to the OS instance from external machines (not sure it will expose/route the virtual ethernet's subnet to the normal router's wifi/ethernet subnet). It should be possible to use a USB wifi dongle directly inside the OS instance to connect to your network instead of the virtual ethernet port, which would make the OS instance directly accessible from any other device on the network. Don't remember the exact process to let instances access USB hardware, but I think there was a fairly simple menu in virtualbox to handle it.

KevinO
04-05-2016, 01:32 PM
Rviz is purely a visualizer. Although it has the ability to set a goal pose message which the navigation stack can pick up and send a cmd_vel message. I recommend getting familiar with Rviz first before trying to use the navigation launch files.... Besides I haven't pushed a bunch of tweaks and documentation to make using the ROS navigation stack with the hexapod stack easier for beginners. To see your robot walk around in rviz you can easily use the teleop package.

In regards to you virtual setup I have a linux laptop (dual boot) so I'm of little help there.

KevinO
04-05-2016, 01:35 PM
From earlier notes from Renee (r3n33):
I launch the hexapod_ros code on the Odroid:
In my case I do:
roslaunch hexapod_bringup phantomx.launch

Note: the phantomx.launch is a copy of the hexapod_simple.launch where I substituted in to use the phantomx and DS3 as the defaults.

Kurt

You are making un-needed work for yourself. :) I have all the launch files setup with config options.

For example:


roslaunch hexapod_bringup hexapod_full.launch config:=phantomX joy_mapping:=joystick_ds3


Or hexapod_simple instead of hexapod_full will give you the same functionality.

KurtEck
04-05-2016, 02:16 PM
Thanks guys,

I decided to make it simpler for myself, so pulled out my HP notebook out of the cabinet, to use. Unfortunately earlier I installed 14.10 on this in the dual boot, which ros indigo does not support and 14.10 is no longer supported. So pulled out my 14.04 install disk and updated it to 14.04... Finished installing, updated grub to remember last boot, now waiting for software updater to finish updates, which will probably take awhile.

You are making un-needed work for yourself. :) I have all the launch files setup with config options.
...

roslaunch hexapod_bringup hexapod_full.launch config:=phantomX joy_mapping:=joystick_ds3
Or hexapod_simple instead of hexapod_full will give you the same functionality.
Thanks Kevin,
Yep was doing that, but then got lazy ;)
This way I can simply type roslaunch hexapod_br<sp> ph<sp> <cr>

Edit: P.S. - it would be interesting to see what things you have found useful to watch using rviz...

Kurt

KurtEck
04-05-2016, 08:31 PM
roslaunch hexapod_bringup hexapod_full.launch config:=phantomX joy_mapping:=joystick_ds3

Quick update:
Now have Ubuntu 14.04 installed on portable along with ROS...

The two machines started to talk after I exported ROS_IP.

And I quickly figured out that the hexapod_simple launch file does not launch enough information to really show information in RVIZ.
Loooking at the hexapod_full.launch
Not sure if the main thing in addition it needs is the robot_localization_ekf.launch or the rtabmap.launch...

My launch of the hexapod_full generates lots of error messages, as I don't have several of the components installed, and in some cases have different hardware:

Example you launch the imu_phidgets.launch. I don't have it setup yet, but on the earlier version I was using a Razor... May use again or may use a different one. Wonder if need config option?

Also not sure of depth_laserscan.launch? Not sure what hardware this is?

Also need to mount camera again add sound...

Now back to playing

KevinO
04-06-2016, 11:56 AM
Quick update:
Now have Ubuntu 14.04 installed on portable along with ROS...

The two machines started to talk after I exported ROS_IP.

And I quickly figured out that the hexapod_simple launch file does not launch enough information to really show information in RVIZ.
Loooking at the hexapod_full.launch
Not sure if the main thing in addition it needs is the robot_localization_ekf.launch or the rtabmap.launch...



I recommend you take the time to read the ros wiki pages for all the packages I'm using. That way you will know what each one is for.



My launch of the hexapod_full generates lots of error messages, as I don't have several of the components installed, and in some cases have different hardware:

Example you launch the imu_phidgets.launch. I don't have it setup yet, but on the earlier version I was using a Razor... May use again or may use a different one. Wonder if need config option?

Not a bad idea!




Also not sure of depth_laserscan.launch? Not sure what hardware this is?



In short I'm converting the depth point cloud into a 2D laser scan for some packages used in the navigation stack.



Also need to mount camera again add sound...

Now back to playing


The more I think about it I don't think the navigation stuff will work without some sort of mapping device. Without that data being received I'm pretty sure it isn't going to send cmd_vel. So you might be out of luck trying out that part of the system. You can still maneuver with the teleop package though.

KurtEck
04-06-2016, 01:11 PM
I recommend you take the time to read the ros wiki pages for all the packages I'm using. That way you will know what each one is for.
I actually do read the pages! Sometimes it just sort-of helps to have hints on which of the pages are relevant to what...

Which is why I was quite sure the one that was needed to get the robot_localization_ekf.launch... Which did help get the robot information over to RVIZ...

Will also hook up Razor for now, plus soon Asus...

Or maybe do something else...

KevinO
04-06-2016, 03:12 PM
The EKF is a kalman filter to merge the calculated odometry with IMU readings. On a flat smooth surface the calculated is perfect on it's own.

KevinO
04-06-2016, 03:32 PM
I also have a node layout of the entire system if that helps you follow who is connected to who.

https://github.com/KevinOchs/hexapod_ros/blob/master/hexapod_description/node_layout/ROS_hexapod.png



https://github.com/KevinOchs/hexapod_ros/blob/master/hexapod_description/node_layout/ROS_hexapod.svg (https://github.com/KevinOchs/hexapod_ros/blob/master/hexapod_description/node_layout/ROS_hexapod.png)

jwatte
04-07-2016, 06:24 PM
On a flat smooth surface the calculated is perfect on it's own

Assuming your wheels don't deform, and your axles are perfectly centered, and everything is straight and square...
Easy in simulation, never true in reality!

KevinO
04-07-2016, 06:45 PM
Assuming your wheels don't deform, and your axles are perfectly centered, and everything is straight and square...
Easy in simulation, never true in reality!

But we are not talking about wheels but my hexapod stack. :) As long as you have properly measured out your hexapod in the xacro file it should be highly accurate. I suppose if your feet slip you could be off.... I've mapped my entire house with odometry that was purely calculated. The point cloud looked great with just higher concentration of points in places I doubled back on.




Edit: (Full disclaimer. I have hardwood floors through out my house. )