Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -442,7 +442,7 @@ void ROSCameraCameraProgram::setBoardPoseParametersVariable() {
}

fs::path ROSCameraCameraProgram::fetchOutputPath() {
if (output_path == "") {
// if (output_path == "") {
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this was breaking package build on the robot, I dont think it is intended

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@fulkast whenever you have time, can you take a look

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is caused by missing changes from the dev/camera_camera_offline_feature branch. For now, this patch here works.

std::string calib_package_name = "box_calibration";
std::filesystem::path calib_root_path = ros::package::getPath(calib_package_name);
if (calib_root_path.empty()) {
Expand All @@ -453,6 +453,6 @@ fs::path ROSCameraCameraProgram::fetchOutputPath() {
"calibration/raw_calibration_output/cameras-intrinsics-extrinsics_latest.yaml";
std::filesystem::path path = calib_root_path / relative_output_path;
return path;
}
return output_path;
// }
// return output_path;
}
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ class ROSCameraCameraProgram : public CameraCameraProgram {
return is_valid;
}
private:

std::filesystem::path fetchOutputPath();
bool computeAndPopulateInitialGuessModelPose(Observations2dModelPoints3dPointIDsPose3dSensorName &observation);

bool
Expand Down
4 changes: 2 additions & 2 deletions box_configuration/anymal/lpc/.bashrc
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,8 @@ HISTCONTROL=ignoreboth
shopt -s histappend

# for setting history length see HISTSIZE and HISTFILESIZE in bash(1)
HISTSIZE=1000
HISTFILESIZE=2000
HISTSIZE=100000
HISTFILESIZE=200000

# check the window size after each command and, if necessary,
# update the values of LINES and COLUMNS.
Expand Down
7 changes: 3 additions & 4 deletions box_configuration/anymal/lpc/alias.sh
Original file line number Diff line number Diff line change
Expand Up @@ -3,12 +3,11 @@
#alias tk='tmux kill-server'
#alias tk_dev='tmux kill-session -a'

alias l-lpc='tmuxp load /home/rsl/git/grand_tour_box/box_launch/tmux/lpc.yaml'
alias l-recording='tmuxp load /home/rsl/git/grand_tour_box/box_launch/tmux/lpc_recording.yaml'
alias l-lpc='tmuxp load /home/${USER}/${GRANDTOUR_SCRIPT_WORKSPACE}/src/grand_tour_box/box_launch/tmux/lpc.yaml'

# Here sim-link does not work
alias chrony_set_box="sudo killall chronyd; sudo rm -f /etc/chrony/chrony.conf; sudo cp /home/rsl/git/grand_tour_box/box_configuration/anymal/lpc/chrony.conf /etc/chrony/chrony.conf; sudo chronyd"
alias chrony_set_box="sudo killall chronyd; sudo rm -f /etc/chrony/chrony.conf; sudo cp /home/${USER}/${GRANDTOUR_SCRIPT_WORKSPACE}/src/grand_tour_box/box_configuration/anymal/lpc/chrony.conf /etc/chrony/chrony.conf; sudo chronyd"
alias chrony_set_default="sudo killall chronyd; sudo rm -f /etc/chrony/chrony.conf; sudo cp /etc/chrony/chrony.conf.orig /etc/chrony/chrony.conf; sudo chronyd"
alias sync-clocks="chrony_set_box; sudo killall chronyd; sudo chronyd"
alias sync-clocks="sudo killall chronyd; sudo chronyd"

alias tk="tmux kill-session -t lpc-box"
10 changes: 3 additions & 7 deletions box_configuration/anymal/lpc/chrony.conf
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ allow 192.168.0.149
allow 10.8.0

##########################3 ENABLE FOR BOX ##############################################
#allow 192.168.2.51
allow 192.168.2.51
######################################################################################

# Get the time from the ntp server pool
Expand Down Expand Up @@ -37,7 +37,7 @@ maxupdateskew 100
#rtcsync

# set process priority
sched_priority 90
sched_priority 95
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

is this required ?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

not required


# lock chronyd into RAM so that it will never be paged out (for lower and more consistent latency)
lock_all
Expand All @@ -49,7 +49,6 @@ logdir /var/log/chrony
# set the threshold for the adjustment of the system clock that will generate a syslog message
logchange 0.5

# Step the system clock

############################## ENABLE FOR BOX ##################################
server 192.168.2.51 iburst minpoll -4 maxpoll -4 prefer
Expand All @@ -58,11 +57,8 @@ server 192.168.2.51 iburst minpoll -4 maxpoll -4 prefer
server anymal-d039-lpc noselect
server anymal-d039-npc noselect

# Step the system clock
hwtimestamp * minpoll -10
# makestep 0.1 -1 # This always steps automatically

# This always steps automatically
# makestep 0.1 -1

# This does not step automatically
makestep 1.0 10
Expand Down
2 changes: 1 addition & 1 deletion box_configuration/anymal/lpc/powerline.service
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ After=anymal-customer-12V-startup.target
[Service]
Type=simple
User=rsl
ExecStart=/bin/bash -c 'source /opt/ros/noetic/setup.bash && source /home/rsl/catkin_ws/devel/setup.bash && python3 /home/rsl/git/grand_tour_box/box_configuration/anymal/lpc/powerline.py'
ExecStart=/bin/bash -c 'source /opt/ros/noetic/setup.bash && source /home/integration/catkin_ws/devel/setup.bash && python3 /home/integration/catkin_ws/src/grand_tour_box/box_configuration/anymal/lpc/powerline.py'
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

we hardcode from one user to the other

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

In anymal robots, the user must exist, in current RSL setup only integration user is used on the robots

Restart=on-failure
RestartSec=5

Expand Down
8 changes: 3 additions & 5 deletions box_configuration/anymal/npc/alias.sh
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,9 @@
#alias tk='tmux kill-server'
#alias tk_dev='tmux kill-session -a'

alias l-npc='tmuxp load /home/rsl/git/grand_tour_box/box_launch/tmux/npc.yaml'
# This is the alais to run on the NPC of the robot.
alias l-npc='tmuxp load /home/${USER}/${GRANDTOUR_SCRIPT_WORKSPACE}/src/grand_tour_box/box_launch/tmux/npc.yaml'

# Here sim-link does not work
alias chrony_set_box="sudo killall chronyd; sudo rm -f /etc/chrony/chrony.conf; sudo cp /home/rsl/git/grand_tour_box/box_configuration/anymal/npc/chrony.conf /etc/chrony/chrony.conf; sudo chronyd"
alias chrony_set_default="sudo killall chronyd; sudo rm -f /etc/chrony/chrony.conf; sudo cp /etc/chrony/grand_tour_box/chrony_robot.conf /etc/chrony/chrony.conf; sudo chronyd"
alias sync-clocks="chrony_set_box; sudo killall chronyd; sudo chronyd"
alias sync-clocks="sudo killall chronyd; sudo chronyd"

alias tk="tmux kill-session -t npc-box"
48 changes: 0 additions & 48 deletions box_configuration/anymal/npc/chrony.conf

This file was deleted.

7 changes: 7 additions & 0 deletions box_launch/scripts/cleanup_session_robot.sh
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,13 @@ killall node_manager
yes y | rosnode cleanup
rm -rf /dev/shm/COSMO_SHM

# On the robot
export GRANDTOUR_WORKSPACE="i_hate_docker_ws"
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

what is this

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I tried to combine all the workspace entries as an environment variable export under cleanup-session-robot script

currently we have a "i_hate_docker_ws" on democracy. Which has the grpc node source code

export GRANDTOUR_SCRIPT_WORKSPACE="boxi_scripts_ws"

# On the Box
export BOX_WORKSPACE="catkin_ws"

if ps aux | grep '[f]kie' > /dev/null; then
ps aux | grep '[f]kie' | awk '{print $2}' | xargs kill
fi
4 changes: 2 additions & 2 deletions box_launch/tmux/lpc.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -15,10 +15,10 @@ windows:
panes:
- shell_command:
- source /opt/ros/noetic/setup.bash
- source ~/catkin_ws/devel/setup.bash
- source /home/${USER}/${GRANDTOUR_WORKSPACE}/devel/setup.bash
- roslaunch box_recording rosbag_record_node_lpc.launch
- shell_command:
- source /opt/ros/noetic/setup.bash
- source ~/catkin_ws/devel/setup.bash
- source /home/${USER}/${GRANDTOUR_WORKSPACE}/devel/setup.bash
- df -h /data
focus: true
4 changes: 2 additions & 2 deletions box_launch/tmux/lpc_recording.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -15,14 +15,14 @@ windows:
panes:
- shell_command:
- source /opt/ros/noetic/setup.bash
- source ~/catkin_ws/devel/setup.bash
- source /home/${USER}/${BOX_WORKSPACE}/devel/setup.bash
- roslaunch bringup_fkie fkie_lpc.launch
autostart_launch_files:="
$(rospack find box_recording)/launch/rosbag_record_node_lpc.launch
"
use_gui:=false
- shell_command:
- source /opt/ros/noetic/setup.bash
- source ~/catkin_ws/devel/setup.bash
- source /home/${USER}/${BOX_WORKSPACE}/devel/setup.bash
- df -h /data
focus: true
4 changes: 2 additions & 2 deletions box_launch/tmux/npc.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -16,10 +16,10 @@ windows:
- shell_command:
- source /etc/robot/ros.conf
- source /opt/ros/noetic/setup.bash
- source ~/catkin_ws/devel/setup.bash
- source /home/${USER}/${GRANDTOUR_WORKSPACE}/devel/setup.bash
- roslaunch box_recording rosbag_record_node_npc.launch
- shell_command:
- source /opt/ros/noetic/setup.bash
- source ~/catkin_ws/devel/setup.bash
- source /home/${USER}/${GRANDTOUR_WORKSPACE}/devel/setup.bash
- df -h /data
focus: true
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,8 @@ def SendMessage(self, request, context):
if self.recorder_node.store_debug_logs:
store_debug_logs_to_folder(
self.recorder_node.start_recording_time,
directory="/home/rsl/.ros",
rospy.Time.now(),
directory=os.path.expanduser("~/.ros"),
copy_to=os.path.join(self.recorder_node.bag_base_path, "ros_logs_" + self.recorder_node.node),
)

Expand Down Expand Up @@ -108,22 +109,36 @@ def __init__(self):
self.namespace = rospy.get_namespace()

self.bag_running = False
default_path = rospkg.RosPack().get_path("box_recording") + "/data"
default_path = "/data"
# TODO: maybe customizable better
# try:
# default_path = rospkg.RosPack().get_path("box_recording") + "/data"
# except rospkg.ResourceNotFound:
# # fallback path if package is not built/installed
# rospy.logwarn("[RosbagRecordNode(" + self.node + ")] Package 'box_recording' not found. It may not be built or installed correctly.")
# default_path = "/data"

self.data_path = rospy.get_param("~data_path", default_path)
self.port = rospy.get_param("~port")

self.info_string = ""

if not os.path.exists(self.data_path):
self.data_path = default_path
rospy.logwarn(
"[RosbagRecordNode("
+ self.node
+ ")] Data path "
+ self.data_path
+ " does not exist. Will write to "
+ default_path
)
try:
os.makedirs(self.data_path, exist_ok=True)
rospy.loginfo("[RosbagRecordNodeGRPC(" + self.node + ")] Created data path: " + self.data_path)
except Exception as e:
rospy.logwarn(
"[RosbagRecordNodeGRPC("
+ self.node
+ ")] Failed to create data path "
+ self.data_path
+ ": "
+ str(e)
+ ". Will write to "
+ default_path
)
self.data_path = default_path

rp = rospkg.RosPack()
self.rosbag_recorder_bash_script = os.path.join(rp.get_path("box_recording"), "bin/record_bag.sh")
Expand All @@ -139,11 +154,6 @@ def __init__(self):
# server.wait_for_termination()


# tomorrow start out by working on wrapping up the correct ports and addresses for the grpc server and client for lpc and npc.
# push the code to a branch on boxi opc - use boxi opc to update the box.
# change all of the fkie setting to the minimum.


if __name__ == "__main__":
rospy.loginfo("Starting ROS bag record node")
RosbagRecordNodeGrpc()
Loading