Monthly Archives: June 2015

Playing around with Gazebo

I thought it would be interesting to see if I could get my current Bioloid URDF file into Gazebo and try out some simulations. It turned out not to be too difficult; in order to load the model in Gazebo, all I had to add to the URDF were inertial elements for each of the links.

I set up a couple of tables and beer cans in the scene, and dropped the poor Bioloid from a height!

If you already have a URDF description of your robot, Gazebo is fairly easy to set up and has great potential for any simulation-based project, however as I am focusing more on the physical robot, I probably won’t be using it much for the time being. That, plus the fact that my laptop can barely handle the program without overheating!

Git repo created

I have just set up a GitHub account and added the ROS setup code I am currently working on. You can find it all at https://github.com/dxydas/ros-bioloid.

As I am a Git noob, here are some useful links which helped me along the way, and which may be of us to others:

Heads up!

The Raspberry Pi has now been fitted to the Bioloid using some spare brackets and sponge padding.

A GUI for the Pi’s screen has also been made using Python, Tkinter and the rospy library. This is actually my first Python program from scratch, so it’s far from perfect but it’s simple and does the job for now!

The program visualises the sensor data from the force sensors and IMU, which the Arduino is publishing on ROS topics. The slider values are unfiltered data, the same which is used by another ROS node to fuse the IMU data and provide a good estimate of the torso’s 3D orientation. The roll/pitch/yaw widgets are used to visualise a simple transformation of the accelerometer/magnetometer data, as was performed previously here. The force sensing resistor (FSR) widget is not active, as the resistors have not been wired in yet, but eventually each FSR’s value will be visualised with a coloured square box ranging from yellow (un-pressed) to red (fully pressed).

Custom Conky on the Raspberry Pi 2

I thought I’d share my Conky configuration currently running on my Pi for anyone interested, as it’s a great tool for displaying useful system information on the desktop. It’s designed for a 480×320 resolution screen, as it is running on this touchscreen, and it takes up all the available space on the Raspbian desktop, minus the menu bar (26 pixels high).

One problem that took me quite a while to solve was how to actually get Conky to launch at startup, as none of the usual methods seemed to work. In the end I found two ways of calling a startup script. First, create a simple Bash script, like this:

#!/bin/bash
sleep 10 && conky -c ~/Scripts/.conkyrc_raspberry-pi-2 -d

Save it e.g. as ~/Scripts/startConky.sh. Then, make the script execute at startup in one of the following two ways:

  1. Open the file /etc/xdg/lxsession/LXDE-pi/autostart as sudo, and add the following line to the end (solution found here):
    @~/Scripts/startConky.sh
    
  2. Alternatively, create a file ~/.config/autostart/startConky.desktop, which contains the following lines (as explained here):
    [Desktop Entry]
    Name=conky
    Type=application
    Exec=/home/pi/Scripts/startConky.sh
    

Here are some screenshots of Conky in action. Feel free to use my config however you want!


My Conky config:


# Conky config file

# Avoid flicker
double_buffer yes

# Window
# Own window to run simultaneous 2 or more conkys
own_window yes
own_window_type normal
own_window_hints undecorated, below, sticky, skip_taskbar, skip_pager
#own_window_transparent yes

# Borders
draw_borders no

# Shades
draw_shades yes

# Position
gap_x 0
gap_y 34
alignment top_middle

# Behaviour
update_interval 2

# Font
#font arial
use_xft yes
#xftfont arial:size=8
xftfont Bitstream Vera Sans Mono:size=8
#xftfont Terminus:size=8
xftalpha 1 # Text alpha when using Xft

# Colours
#default_color d1d3c9
#default_shade_color 000000
own_window_colour 2B2B2B

# Prevent window from moving
use_spacer none

# Minimum size of window
minimum_size 464 280

# Maximum width of window
maximum_width 464


TEXT
${font Arial:size=12}${color #ddaa00}${time %I:%M %p}${font}            $alignc${color #9fb6cd}UpTime: ${color }$uptime $alignr${color #9fb6cd}Temp.: ${color ff0000}${execi 2 vcgencmd measure_temp | sed 's/[^0-9.]*//g'} °C
${color }${hr}
${color #9fb6cd}CPUs${color }
${color #9fb6cd}1: ${color }${cpugauge cpu1 30, 60}  ${cpugraph cpu1, 30, 125 ffff00 ff0000 -t} $alignr${color #9fb6cd}2: ${color }${cpugauge cpu2 30, 60}  ${cpugraph cpu2, 30, 125 ffff00 ff0000 -t}
${color #9fb6cd}3: ${color }${cpugauge cpu3 30, 60}  ${cpugraph cpu3, 30, 125 ffff00 ff0000 -t} $alignr${color #9fb6cd}4: ${color }${cpugauge cpu4 30, 60}  ${cpugraph cpu4, 30, 125 ffff00 ff0000 -t}
${color }${hr}
${color #9fb6cd}MEM
${color }${memgauge 30, 60}  $alignr${memgraph 30, 380 0000ff ffff00 -t}
${color }${hr}
${color #9fb6cd}UP $alignc${color #9fb6cd}IP: ${color }${addr wlan0} $alignr${color #9fb6cd}DOWN
${color }${upspeedgraph wlan0 30, 220 0000ff ff0000 -t} $alignr${downspeedgraph wlan0 30, 220 0000ff 00ff00 -t}