Skip to content

Commit 66cf749

Browse files
committed
little cleaning the commented code and spaces
1 parent f10d50c commit 66cf749

File tree

3 files changed

+4
-25
lines changed

3 files changed

+4
-25
lines changed

rotors_driver/src/rotors_driver_node.py

Lines changed: 1 addition & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -218,7 +218,6 @@ def rotors_arm(self, req):
218218
self.__is_armed = True
219219
time.sleep(1) # waits 1 sec
220220
tk_req = CommandTOL()
221-
# success, result = self.rotors_takeoff_land(1) # arming is actually taking off in OFFBOARD flight mode
222221
return True, 1
223222
else:
224223
rospy.loginfo("Firefly Disarming")
@@ -245,13 +244,8 @@ def rotors_change_speed(self, speed):
245244
'''speed in m/s'''
246245
speed = self.CONSTRAINTS.constraint_speed(int(speed)*100) # to cm/s
247246

248-
# if self.__send_cmd("speed {}".format(str(speed))):
249-
# rospy.loginfo("Rotors drone speed updated to " + str(speed))
250-
# rospy.set_param("/rotors/speed", speed)
251247
return True
252-
# else:
253-
# return False
254-
248+
255249
def rotors_param_set(self, param_id, value=float(12.0)):
256250
# string param_id
257251
# mavros_msgs/ParamValue value
@@ -321,7 +315,6 @@ def publish_position_desired(self, msg):
321315

322316

323317

324-
# print("publishing","current x:",self.current_x, "current y:",self.current_y, "current z:", self.current_z, "current des_vel_x:", self.vx_des, "current des_vel_y:", self.vy_des, "current des_vel_z:", self.vz_des)
325318

326319
quaternion = tf.transformations.quaternion_from_euler(0, 0, desired_yaw_to_go)
327320

@@ -356,7 +349,6 @@ def publish_position_desired(self, msg):
356349

357350

358351
rospy.spin()
359-
# rospy.loginfo(" >> Published waypoint: x: {}, y: {}, z: {}, yaw: {}".format(x_des, y_des, z_des, yaw_des,vx_des, vy_des, vz_des))
360352

361353

362354
except rospy.ROSInterruptException:

rotors_driver/test/test_pubs.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -18,8 +18,8 @@
1818
TEMP = "{}\n" \
1919
"\n" \
2020
"###########################\n" \
21-
"# TELLO STATUS #\n" \
22-
"# #\n" \
21+
"# ROTORS STATUS #\n" \
22+
"# (some are dummy params) #\n" \
2323
"# MODE: {} #\n" \
2424
"# STATE: {} #\n" \
2525
"# BAT: {:02d} % #\n" \
@@ -70,7 +70,7 @@ def global_cb(msg):
7070

7171

7272
def print_status():
73-
os.system('clear') # Elegant-less
73+
os.system('clear')
7474
print(TEMP.format(CONT, state.mode, ext_state_codes[ext_state], bat_percent, h), end='\r')
7575

7676

rotors_driver/test/test_rotors_driver.py

Lines changed: 0 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -6,23 +6,10 @@
66
import time
77

88
from drone_wrapper import DroneWrapper
9-
# setpoint_raw_publisher = rospy.Publisher('mavros/setpoint_raw/local', PositionTarget, queue_size=1)
109

1110
d = DroneWrapper()
1211
time.sleep(5.0)#for letting the rotors node initialise
1312

14-
# a =d.get_frontal_image()
15-
# print("pos:",a)
16-
# time.sleep(3)
17-
18-
# time.sleep(2.0)
19-
# d.set_cmd_pos(0.0,0.0,3.0,0.0)
20-
# time.sleep(3.0)
21-
# d.set_cmd_vel(0.3,0.3,0.0,0.0)
22-
# time.sleep(3.5)
23-
# d.set_cmd_mix(0.3,0.3,1.0,0.0)
24-
# time.sleep(3.5)
25-
# time.sleep(5)
2613
while True:
2714
d.set_cmd_pos(0.0,0.0,3.0,0.0)
2815
time.sleep(0.5)

0 commit comments

Comments
 (0)