Author Topic: I want to control kh4 by matlab  (Read 3331 times)

zainab

  • Jr. Member
  • **
  • Posts: 5
  • Karma: +0/-0
I want to control kh4 by matlab
« on: December 09, 2015, 11:58:52 PM »
Hi
I want to control kh4 using matlab
i run command /etc/init.d/bluetooth restart and the Bluetooth was stopped
i dont know where i run ./kh4server and config matlab
can you give me the steps to do it

kteam

  • Administrator
  • Hero Member
  • *****
  • Posts: 378
  • Karma: +7/-1
Re: I want to control kh4 by matlab
« Reply #1 on: December 17, 2015, 10:46:27 AM »
Hello,

everything is explain in the manual chapter 6 (communication protocol).

But it's quite simple, once you have established your Bluetooth connection, you will be able to login through Bluetooth (using a terminal with the associated COM port). Now you can run the kh4_server on the Robot (copy it in your Robot if not present).

After that, every data send to the terminal through Bluetooth will be considered as a command to remote control the robot (as explain in the chapter 6).

For Matlab, you simply need to manage this COM port with the command describe.

Only when you have validated the connection, you can change the Bluetooth parameter and run automatically the server (as explain in the manual).

Best regards

zainab

  • Jr. Member
  • **
  • Posts: 5
  • Karma: +0/-0
Re: I want to control kh4 by matlab
« Reply #2 on: December 17, 2015, 06:10:06 PM »
Thanks,, I  implemented all the steps but after the restart Bluetooth I can not access to robot to run ./kh4server
******
Is there matlab library for khepera4 must be install it???????????

zainab

  • Jr. Member
  • **
  • Posts: 5
  • Karma: +0/-0
Re: I want to control kh4 by matlab
« Reply #3 on: December 17, 2015, 08:03:25 PM »
i can not log in to robot after running steps in chapter 6
the terminal is below:
Caching udev devnodes
Populating dev cache
NET: Registered protocol family 10
ALSA: Restoring mixer settings...
Cleaning: /etc/network/run/ifstate.
Configuring network interfaces... ADDRCONF(NETDEV_UP): wlan4: link is not ready
done.
Starting portmap daemon: portmap.
net.ipv4.conf.default.rp_filter = 1
net.ipv4.conf.all.rp_filter = 1
Tue Jun 18 08:26:00 UTC 2013
Turning echo off on /dev/ttyS1
INIT: Entering runlevel: 5
Starting system message bus: dbus.
Starting Hardware abstraction layer hald
Starting OpenBSD Secure Shell server: sshd
done.
Starting advanced power management daemon: No APM support in kernel
(failed.)
Starting Vixie-cron.
Starting ntpd: done
Starting syslog-ng:.
 * Starting Avahi mDNS/DNS-SD Daemon: avahi-daemon                       [ ok ]
Starting Bluetooth subsystem:
CSR build ID 0x0C-0x5C
Device setup complete
 ttyS1 bluetoothd hid2hciWaiting for connection on channel