<commit_before>#!/usr/bin/env python

'''
Enables users to telemanipulate Dreamer's end effectors via CARL.
Uses WBOSC configured with end effector Cartesian position and orientation.

-----------------
Dependency notes:

If you're using Python 2.7, you need to install Python's
enum package. Download it from here: https://pypi.python.org/pypi/enum34#downloads
Then run:
  $ sudo python setup.py install

Visualzing the FSM requires smach_viewer:
  $ sudo apt-get install ros-indigo-smach-viewer
You will need to modify /opt/ros/indigo/lib/python2.7/dist-packages/xdot/xdot.py
lines 487, 488, 593, and 594 to contain self.read_float() instead of self.read_number().

-----------------
Usage Notes:

To issue a command using the command line:

  exit:
    $ rostopic pub --once /demo9/cmd std_msgs/Int32 'data: 0'

  go to ready:
    $ rostopic pub --once /demo9/cmd std_msgs/Int32 'data: 1'

  go to idle:
    $ rostopic pub --once /demo9/cmd std_msgs/Int32 'data: 2'

To visualize FSM:
  $ rosrun smach_viewer smach_viewer.py
'''

import sys, getopt     # for getting and parsing command line arguments
import time
import math
import threading
import rospy
import smach
import smach_ros

from enum import IntEnum

from std_msgs.msg import Float64, Float64MultiArray, MultiArrayDimension, Bool, Int32

import numpy as np
from scipy.interpolate import interp1d
import matplotlib.pyplot as plt
from mpl_toolkits.mplot3d import Axes3D

print(sys.path)


import DreamerInterface
import Trajectory
import TrajectoryGeneratorCubicSpline

import roslib; roslib.load_manifest('controlit_dreamer_integration')
import TrapezoidVelocityTrajGen

# The previous demos that we would like to execute
import Demo4_HandWave
import Demo5_HandShake
import Demo7_HookemHorns

ENABLE_USER_PROMPTS = False

# Shoulder abductors about 10 degrees away from body and elbows bent 90 degrees
# DEFAULT_POSTURE = [0.0, 0.0,                                    # torso
#                    0.0, 0.174532925, 0.0, 1.57, 0.0, 0.0, 0.0,  # left arm
#                    0.0, 0.174532925, 0.0, 1.57, 0.0, 0.0, 0.0]  # right arm<commit_msg>Fixed bug in demo 9 that prevented it from importing TrapezoidVelocityTrajGen from package controlit_trajectory_generators.<commit_after>#!/usr/bin/env python

'''
Enables users to telemanipulate Dreamer's end effectors via CARL.
Uses WBOSC configured with end effector Cartesian position and orientation.

-----------------
Dependency notes:

If you're using Python 2.7, you need to install Python's
enum package. Download it from here: https://pypi.python.org/pypi/enum34#downloads
Then run:
  $ sudo python setup.py install

Visualzing the FSM requires smach_viewer:
  $ sudo apt-get install ros-indigo-smach-viewer
You will need to modify /opt/ros/indigo/lib/python2.7/dist-packages/xdot/xdot.py
lines 487, 488, 593, and 594 to contain self.read_float() instead of self.read_number().

-----------------
Usage Notes:

To issue a command using the command line:

  exit:
    $ rostopic pub --once /demo9/cmd std_msgs/Int32 'data: 0'

  go to ready:
    $ rostopic pub --once /demo9/cmd std_msgs/Int32 'data: 1'

  go to idle:
    $ rostopic pub --once /demo9/cmd std_msgs/Int32 'data: 2'

To visualize FSM:
  $ rosrun smach_viewer smach_viewer.py
'''

import sys, getopt     # for getting and parsing command line arguments
import time
import math
import threading
import rospy
import smach
import smach_ros

from enum import IntEnum

from std_msgs.msg import Float64, Float64MultiArray, MultiArrayDimension, Bool, Int32

import numpy as np
from scipy.interpolate import interp1d
import matplotlib.pyplot as plt
from mpl_toolkits.mplot3d import Axes3D

print(sys.path)


import DreamerInterface
import Trajectory
import TrajectoryGeneratorCubicSpline

import roslib; roslib.load_manifest('controlit_dreamer_integration')

import controlit_trajectory_generators  # This adds the directory containing TrapezoidVelocityTrajGen to the PYTHONPATH
import TrapezoidVelocityTrajGen

# The previous demos that we would like to execute
import Demo4_HandWave
import Demo5_HandShake
import Demo7_HookemHorns

ENABLE_USER_PROMPTS = False

# Shoulder abductors about 10 degrees away from body and elbows bent 90 degrees
# DEFAULT_POSTURE = [0.0, 0.0,                                    # torso
#                    0.0, 0.174532925, 0.0, 1.57, 0.0, 0.0, 0.0,  # left arm
#                    0.0, 0.174532925, 0.0, 1.57, 0.0, 0.0, 0.0]  # right arm
{'fraction_non_alphanumeric': 0.08732838172406032, 'fraction_numerical': 0.04343911771325681, 'mean_word_length': 3.502532928064843, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 2, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 8, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '2558845', 'n_tokens_mistral': 1627, 'n_tokens_neox': 1468, 'n_words': 485}