Skip to content

Commit ddfecc7

Browse files
committed
Fix Python print methods
1 parent 948a4d6 commit ddfecc7

File tree

5 files changed

+28
-28
lines changed

5 files changed

+28
-28
lines changed

ambf_models/descriptions/input_devices/input_devices.yaml

+1-1
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ MTMR:
4444

4545

4646
Geomagic Touch:
47-
hardware name: PHANTOM Omni
47+
hardware name: Touch
4848
haptic gain: {linear: 10.0, angular: 0.0}
4949
# controller gain: {
5050
# linear: {P: 0.0, D: 0.0},

ambf_ros_modules/ambf_client/python/tests/dynamo_haptic_response_test.py

+6-6
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ def __init__(self, name):
2222
self.data_lim = 1000
2323
if len(sys.argv) > 1:
2424
self.data_lim = int(sys.argv[1])
25-
print 'Taking {} data points'.format(sys.argv[1])
25+
print('Taking {} data points'.format(sys.argv[1]))
2626
self.data = np.zeros(self.data_lim)
2727
self.ctr = 0
2828
self.name = name
@@ -50,11 +50,11 @@ def compute_data_metrics(self):
5050
self._mean = np.mean(self.data)
5151
self._std_dev = np.std(self.data)
5252

53-
print '----------------------------------'
54-
print 'Data Metrics for {}'.format(self.name)
55-
print 'Mean = {}'.format(self._mean)
56-
print 'Std Deviation = {}'.format(self._std_dev)
57-
print '----------------------------------'
53+
print('----------------------------------')
54+
print('Data Metrics for {}'.format(self.name))
55+
print('Mean = {}'.format(self._mean))
56+
print('Std Deviation = {}'.format(self._std_dev))
57+
print('----------------------------------')
5858

5959
def get_mean(self):
6060
return self._mean

ambf_ros_modules/ambf_client/python/tests/spacenav_control.py

+3-3
Original file line numberDiff line numberDiff line change
@@ -118,7 +118,7 @@ def main():
118118

119119
parsed_args = parser.parse_args()
120120
print('Specified Arguments')
121-
print parsed_args
121+
print(parsed_args)
122122

123123
_spacenav_one_name = parsed_args.spacenav_name
124124
_obj_one_name = parsed_args.obj_name
@@ -130,8 +130,8 @@ def main():
130130
client.connect()
131131

132132
if _print_obj_names:
133-
print ('Printing Found AMBF Object Names: ')
134-
print client.get_obj_names()
133+
print('Printing Found AMBF Object Names: ')
134+
print(client.get_obj_names())
135135
exit()
136136

137137
_pair_one_specified = True

ambf_ros_modules/ambf_client/python/tests/study_analysis.py

+12-12
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ def compute_dist(topic_name, t_start=-1, t_end=-1):
3535
dist = 0.0
3636
dist = dist + 1000 * np.matmul((cur - last), (cur - last))
3737
last = cur
38-
# print dist
38+
# print(dist)
3939
return dist, trajectory
4040

4141

@@ -73,35 +73,35 @@ def compute_number_of_clutches(topic_name, t_start=-1, t_end=-1):
7373
return num_clutches, clutch_press_times
7474

7575

76-
print os.listdir('.')
76+
print (os.listdir('.'))
7777
os.chdir('./user_study_data/')
78-
print os.listdir('.')[0]
78+
print(os.listdir('.')[0])
7979

8080
os.chdir(os.listdir('.')[3])
8181
os.chdir('./Reduced')
8282
files = os.listdir('.')
8383

8484
for cur_file in files:
85-
print '--------------------------------'
86-
print '--------------------------------'
87-
print "Opening Bag file: ", cur_file
85+
print('--------------------------------')
86+
print('--------------------------------')
87+
print("Opening Bag file: ", cur_file)
8888

8989
print(cur_file.split('_'))
9090
control_type = cur_file.split('_')
9191
# control_type = control_type[1] + ' ' + control_type[2]
92-
print "Subject Name: ", control_type[1], "Control Type: ", control_type[2]
92+
print("Subject Name: ", control_type[1], "Control Type: ", control_type[2])
9393

9494
cur_bag = rosbag.Bag(cur_file)
9595

96-
print cur_bag.get_end_time() - cur_bag.get_start_time()
96+
print(cur_bag.get_end_time() - cur_bag.get_start_time())
9797

9898
ctr = 0
9999
final_time = 0
100100
for topic, msg, time in cur_bag.read_messages(['/ambf/env/user_study_time']):
101-
# print 'TOPIC: ', topic
102-
# print 'TIME: ', time
103-
# print 'MESSAGE: ', msg
104-
# print 'COUNTER: ', ctr
101+
# print('TOPIC: ', topic)
102+
# print('TIME: ', time)
103+
# print('MESSAGE: ', msg)
104+
# print('COUNTER: ', ctr)
105105
ctr = ctr + 1
106106
final_time = time
107107

ambf_ros_modules/ambf_client/python/tests/test_pc.py

+6-6
Original file line numberDiff line numberDiff line change
@@ -11,22 +11,22 @@
1111
# AMBF Will have a default PC listener at /ambf/env/World/point_cloud'
1212
pc_topics = rospy.get_param(topics_names_param)
1313

14-
print 'Existing Topics AMBF is listening to for Point Cloud'
15-
print pc_topics
14+
print('Existing Topics AMBF is listening to for Point Cloud')
15+
print(pc_topics)
1616

1717
time.sleep(1.0)
1818
# We can add topics by using the Param Server
1919
pc_topics.append('/ambf/env/World/another_point_cloud')
2020
rospy.set_param(topics_names_param, pc_topics)
21-
print 'Adding another topic via the ROS Param server'
21+
print('Adding another topic via the ROS Param server')
2222

23-
print 'Updated topics on the param server are now:'
23+
print('Updated topics on the param server are now:')
2424
pc_topics = rospy.get_param('/ambf/env/World/point_cloud_topics')
25-
print pc_topics
25+
print(pc_topics)
2626

2727
time.sleep(1.0)
2828

29-
print "We can similarly update the size of each individual PC"
29+
print("We can similarly update the size of each individual PC")
3030

3131
pc_sizes = rospy.get_param(topics_size_param)
3232
pc_sizes.append(10) # 10 pt size for first PC

0 commit comments

Comments
 (0)