<commit_before>#!/bin/bash
# Start HERB2 functionalities in tmux sessions
# to kill all sessions:      pkill -f tmux
# to attach to a session:    tmux a -t <session_name>
# to detach from a session:  <ctrl + b> + d

function launcher {
    tmux has-session -t $1 2>/dev/null
    if [ "$?" -eq 0 ] ; then
        echo "WARNING! $1 is already running! (tmux session)"
    elif screen -ls | grep -q $1 ; then
        echo "WARNING! $1 is already running! (screen session)"
    else
        echo "Creating a new tmux session: $1"
	tmux new-session -d -s $1
	tmux send -t $1 "source $(catkin locate)/devel/setup.bash && $2$(printf \\r)"
    fi
}

function pr_herb2_launcher {
    launcher $1 "roslaunch herb_launch $2 --wait"
}

function neck_can_reset {
    echo "reset can0 for schunk_neck"
    sudo ifconfig can0 down
    sudo ip link set up can0 type can bitrate 500000 triple-sampling on
}

export ROS_MASTER_URI=http://herb0:11311/

export PYTHONPATH=$PYTHONPATH:/home/herb_admin/tensorflow_models/research:/home/herb_admin/tensorflow_models/research/slim

cd /home/herb_admin/herb2_ws/
source $(catkin locate)/devel/setup.bash

neck_can_reset

#pr_herb2_launcher "kinect2"       "kinect2_bridge_cpu.launch"
pr_herb2_launcher "multisense"    "multisense.launch"
pr_herb2_launcher "apriltags"	  "apriltags_multisense.launch"
pr_herb2_launcher "rcnn_moped"    "rcnn_moped.launch"
launcher          "schunk_neck"   "rosrun schunk_neck schunk_neck_node"
launcher          "neck_simple"   "rosrun schunk_neck can_send_service" 

sleep 3s
rosrun dynamic_reconfigure dynparam set multisense lighting true
rosrun dynamic_reconfigure dynparam set multisense led_duty_cycle 0.04
rosrun dynamic_reconfigure dynparam set multisense led_duty_cycle 0.01
rosrun dynamic_reconfigure dynparam set multisense motor_speed 0.5
rosservice call /schunk_neck/move_pos_simple -- t 30 a
sleep 2s<commit_msg>update start_herb2_tmux.sh according to the new neck controls<commit_after>#!/bin/bash
# Start HERB2 functionalities in tmux sessions
# to kill all sessions:      pkill -f tmux
# to attach to a session:    tmux a -t <session_name>
# to detach from a session:  <ctrl + b> + d

function launcher {
    tmux has-session -t $1 2>/dev/null
    if [ "$?" -eq 0 ] ; then
        echo "WARNING! $1 is already running! (tmux session)"
    elif screen -ls | grep -q $1 ; then
        echo "WARNING! $1 is already running! (screen session)"
    else
        echo "Creating a new tmux session: $1"
	tmux new-session -d -s $1
	tmux send -t $1 "source $(catkin locate)/devel/setup.bash && $2$(printf \\r)"
    fi
}

function pr_herb2_launcher {
    launcher $1 "roslaunch herb_launch $2 --wait"
}

function neck_can_reset {
    echo "reset can0 for schunk_neck"
    sudo ifconfig can0 down
    sudo ip link set up can0 type can bitrate 500000 triple-sampling on
}

export ROS_MASTER_URI=http://herb0:11311/

export PYTHONPATH=$PYTHONPATH:/home/herb_admin/tensorflow_models/research:/home/herb_admin/tensorflow_models/research/slim

cd /home/herb_admin/herb2_ws/
source $(catkin locate)/devel/setup.bash

neck_can_reset

#pr_herb2_launcher "kinect2"       "kinect2_bridge_cpu.launch"
pr_herb2_launcher "multisense"    "multisense.launch"
pr_herb2_launcher "apriltags"	  "apriltags_multisense.launch"
pr_herb2_launcher "rcnn_moped"    "rcnn_moped.launch"
launcher          "schunk_neck"   "rosrun schunk_neck schunk_neck_node"
launcher          "image_echo"    "rostopic hz /multisense/left/image_rect_color"
launcher          "lidar_echo"    "rostopic hz /multisense/lidar_points2"

sleep 3s
rosrun dynamic_reconfigure dynparam set multisense lighting true
rosrun dynamic_reconfigure dynparam set multisense led_duty_cycle 0.04
rosrun dynamic_reconfigure dynparam set multisense led_duty_cycle 0.01
rosrun dynamic_reconfigure dynparam set multisense motor_speed 1.0
rosservice call /schunk_neck/set_state -- 0 30
sleep 2s
{'fraction_non_alphanumeric': 0.08536898945744407, 'fraction_numerical': 0.02545641553098483, 'mean_word_length': 3.94910941475827, 'pattern_counts': {'":': 0, '<': 7, '<?xml version=': 0, '>': 9, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '6786218', 'n_tokens_mistral': 1493, 'n_tokens_neox': 1365, 'n_words': 388}