Raspberry Pi X-Mode
Posted: Mon Jun 10, 2013 2:39 pm
I've tried searching for this using Google and the forum search, but i haven't found any results. Please let me know if there are any existing resources about this.
I used this tutorial to turn my Raspberry Pi into a base station:
http://wiki.bitcraze.se/projects:crazyf ... rasberrypi
Everything works perfectly, but i'm used to flying in "x" mode, and I have been unable to enable this mode. I have tried changing “client_side_xmode” to “true” in “crazyflie-pc-client/lib/cfclient/configs/config.json”, but that doesn't seem to change it. Here's the contents of that config file:
Does the headless Linux version even support client side xmode? I found this on line 283 of "crazyflie-pc-client/lib/cfclient/ui/tabs/FlightTab.py":
But no corresponding line for the headless (non-UI) version.
Which corresponds to this in "crazyflie-pc-client/lib/cflib/crazyflie/commander.py":
It's looking like the headless version doesn't ever set the xmode, The quick solution is to change commander.py to initialize with xmode set to true (this works), but i would rather not start hacking things if there's an existing solution i'm overlooking. Am i crazy, or barking up the wrong tree?
I used this tutorial to turn my Raspberry Pi into a base station:
http://wiki.bitcraze.se/projects:crazyf ... rasberrypi
Everything works perfectly, but i'm used to flying in "x" mode, and I have been unable to enable this mode. I have tried changing “client_side_xmode” to “true” in “crazyflie-pc-client/lib/cfclient/configs/config.json”, but that doesn't seem to change it. Here's the contents of that config file:
Code: Select all
{
"writable" : {
"input_device": "",
"link_uri": "",
"flightmode": "Advanced",
"open_tabs": "Flight Control",
"trim_pitch": 0.0,
"slew_limit": 45,
"slew_rate": 30,
"trim_roll": 0.0,
"max_thrust": 80,
"min_thrust": 25,
"max_yaw": 200,
"max_rp": 30,
"client_side_xmode": true,
"device_config_mapping": {}
},
"read-only" : {
"normal_slew_limit": 45,
"normal_slew_rate": 30,
"normal_max_thrust": 80,
"normal_min_thrust": 25,
"normal_max_yaw": 200,
"normal_max_rp": 30,
"default_cf_channel": 10,
"default_cf_speed": 0,
"default_cf_trim": 0
}
}
Code: Select all
self.helper.cf.commander.set_client_xmode(checked)
Which corresponds to this in "crazyflie-pc-client/lib/cflib/crazyflie/commander.py":
Code: Select all
def set_client_xmode(self, enabled):
"""
Enable/disable the client side X-mode. When enabled this recalculates
the setpoints before sending them to the Crazyflie.
"""
self._x_mode = enabled