Exemple #1
0
	def deploy(self):
		trajectory_msg = create_multi_dof_joint_trajectory_msg(1)

		trajectory_msg.points[0].transforms[0].translation.x = self.x0[0] + self.offset[0]
		trajectory_msg.points[0].transforms[0].translation.y = self.x0[1] + self.offset[1]
		trajectory_msg.points[0].transforms[0].translation.z = self.altitude
		
		self.trajectory_msg_pub.publish(trajectory_msg)
Exemple #2
0
	def play(self):
		u = [.1, .1, 0.]

		trajectory_msg = create_multi_dof_joint_trajectory_msg(1)
		trajectory_msg.joint_names[0] = 'acceleration_altitude'

		trajectory_msg.points[0].accelerations[0].linear.x = u[0]
		trajectory_msg.points[0].accelerations[0].linear.y = u[1]
		trajectory_msg.points[0].transforms[0].translation.z = self.altitude

		self.trajectory_msg_pub.publish(trajectory_msg)
Exemple #3
0
	def play(self):
		u_pref = self.strategy()
		orca_self = Agent(self.state.x, self.state.v, .1, u_pref)
		orca_other = []

		for other, state in self.state_team_neigh.items():
			orca_other.append(Agent(state.x, state.v, .1, (0, 0)))

		u, _ = orca(orca_self, orca_other, 2., 1e-2)
		
		# print(str(self), u_pref, u)

		trajectory_msg = create_multi_dof_joint_trajectory_msg(1)

		trajectory_msg.points[0].velocities[0].linear.x = u[0]
		trajectory_msg.points[0].velocities[0].linear.y = u[1]
		trajectory_msg.points[0].transforms[0].translation.z = self.altitude

		# self.capture_handler(*arg)

		self.trajectory_msg_pub.publish(trajectory_msg)
Exemple #4
0
	def land(self):
		trajectory_msg = create_multi_dof_joint_trajectory_msg(1)
		trajectory_msg.joint_names[0] = 'acceleration_altitude'

		self.trajectory_msg_pub.publish(trajectory_msg)
Exemple #5
0
	def land(self):
		trajectory_msg = create_multi_dof_joint_trajectory_msg(1)

		self.trajectory_msg_pub.publish(trajectory_msg)
Exemple #6
0
	def win(self):
		trajectory_msg = create_multi_dof_joint_trajectory_msg(1)
		trajectory_msg.points[0].transforms[0].translation.z = self.altitude+.3

		self.trajectory_msg_pub.publish(trajectory_msg)