Skip to content

Instantly share code, notes, and snippets.

View HemaZ's full-sized avatar
🇵🇸
Free Palestine

Ibrahim Essam HemaZ

🇵🇸
Free Palestine
View GitHub Profile
@HemaZ
HemaZ / ros_tf2.md
Last active December 24, 2021 09:12
ROS TF2 code snippts

Prodcasting a transform

Static TF

C++

#include "geometry_msgs/TransformStamped.h"
#include "ros/ros.h"
#include "tf2/LinearMath/Quaternion.h"
@HemaZ
HemaZ / eigen_in_c.md
Last active June 17, 2021 13:41
Using Eigen in C project

TestCPP.hpp

#ifndef __TESTCPP_H__
#define __TESTCPP_H__
#ifdef __cplusplus
extern "C" {
#endif
void sayTestCpp(); // Print Hi from C++
void EigenTest();  // use a simple Eigen arithmetics.
<?xml version="1.0"?>
<launch>
<arg name="model" default="$(find prius_description)/urdf/prius.urdf" />
<arg name="rvizconfig" default="$(find car_demo)/rviz/demo.rviz" />
<arg name="x" default="3" />
<arg name="y" default="-12" />
<param name="robot_description" textfile="$(arg model)" />
import subprocess
import os
import time
import signal
class Prius:
def on_start(self):
front_camera = self.get_port_info("front_camera/image_raw")["topic"] # we wii use this to get Block id
x = self.get_property("x") # get x location form block's property
y = self.get_property("y") # get y location from block's property
workspace_path = os.path.join(self.get_property("ws_path"), "") # get the workspace path from the block's property
<?xml version="1.0"?>
<launch>
<arg name="model" default="$(find prius_description)/urdf/prius.urdf" />
<!-- Take Bloc Id from YonoArc and use it as namespace -->
<arg name="block_id" default="b12" />
<!-- Car Location also from YonoArc -->
<arg name="x" default="3" />
<arg name="y" default="-12" />
<group ns="$(arg block_id)">
<?xml version="1.0"?>
<launch>
<include file="$(find gazebo_ros)/launch/empty_world.launch">
<arg name="verbose" value="true" />
<arg name="world_name" value="$(find car_demo)/worlds/mcity.world" />
<arg name="gui" value="true" />
</include>
</launch>
import subprocess
import os
import time
class Gazebo:
def on_start(self):
"""This block is used to launch gazebo in noVNC
it builds the ros workspace, source it , then run a launch file
which run gazebo ros and load the appropriate world file.
"""
self.ws_path = self.get_property("ws_path") # Workspace Path
import subprocess
import os
import time
class Gazebo:
def on_start(self):
# Get the world file path form block's properties
self.world_file = self.get_property("world_file")
# Get the models files path form block's properties
self.models_path = self.get_property("models_path")

FreePalestine.Dev

Installing ROS Noetic on Raspberry Pi 4

Hello Everyone. I've been trying to install ROS Noetic on Raspbian GNU/Linux 10 (buster) from source but it was like a nightmare. Finally, I was able to install it and I want to share it with you.

Steps:

$ sudo sh -c 'echo "deb http://packages.ros.org/ros/ubuntu $(lsb_release -sc) main" > /etc/apt/sources.list.d/ros-latest.list'

class AirSim:
def parse_lidarData(self, data):
# function to create PointCloud2 from Lidar Data
# reshape array of floats to array of [X,Y,Z]
points = np.array(data.point_cloud, dtype=np.dtype('f4'))
points = np.reshape(points, (int(points.shape[0]/3), 3))
header = Header()
header.frame_id = "lidar"
pcl = pcl2.create_cloud_xyz32(header, points)
return pcl