Revision 122a57d8

View differences:

quad2/altitude_node/src/altitude_node.cpp
32 32
  enable_sub = n.subscribe<std_msgs::Bool>("/altitude_node/enable",
33 33
      100, &AltitudeNode::enable_cb, this);
34 34
  pub = n.advertise<std_msgs::Float64>("/mikrokopter/thrust", 100);
35
  
36
  float default_goal;
37
  ros::param::param<float>("~default_goal", default_goal, 0);
38
  pid.change_goal(default_goal);
35 39
}
36 40

  
37 41
void AltitudeNode::height_cb(const mikrokopter::FcDebug::ConstPtr& fc)
quad2/joystick_node/src/joystick_node.cpp
48 48
  yaw.data = -joy->axes[2];
49 49
  yaw_pub.publish(yaw);
50 50
  
51
  bool alt_en_down = joy->buttons[0];
51
  bool alt_en_down = joy->buttons[10]; // button 11
52 52
  if (alt_en_down && !alt_en_pressed) // toggle altitude control
53 53
  {
54 54
    altitude_enabled = !altitude_enabled;
quad2/launch/joystick_control.launch
1 1
<launch>
2 2

  
3 3
    <node name="joystick_node" pkg="joystick_node" type="joystick_node"/>
4
    <node name="altitude_node" pkg="altitude_node" type="altitude_node"/>
4
    <node name="altitude_node" pkg="altitude_node" type="altitude_node">
5
        <param name="default_goal" value="0"/>
6
    </node>
5 7
    <node name="node_control" pkg="mikrokopter" type="node_control">
6
        <param name="publish_rate" value="20" />
8
        <param name="publish_rate" value="20"/>
7 9
    </node>
8 10
    <node name="joy_node" pkg="joy" type="joy_node"/>
9 11

  

Also available in: Unified diff