Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
52 commits
Select commit Hold shift + click to select a range
764d797
Setup 2
roncanciovl Feb 15, 2023
6cf7569
SALUDO
Zern291 Feb 15, 2023
165b125
Created pkg lolito
roncanciovl Feb 15, 2023
8b387c7
Merge branch 'test' of https://github.com/roncanciovl/Robot-over-ROS2…
roncanciovl Feb 15, 2023
d091143
willy loco
Zern291 Feb 16, 2023
8b09edb
cambio pa reyes
WILLY160116 Feb 16, 2023
467b5d9
readme update
roncanciovl Feb 16, 2023
f94121e
Merge branch 'test' of https://github.com/roncanciovl/Robot-over-ROS2…
roncanciovl Feb 16, 2023
965193f
saludos
Zern291 Feb 16, 2023
09fd0ec
hola
WILLY160116 Feb 16, 2023
6b3768b
hola
WILLY160116 Feb 16, 2023
907c486
g
WILLY160116 Feb 16, 2023
b33a750
ALo123
Ayvan77 Feb 16, 2023
c01dfad
alo
RaulUrdaneta Feb 16, 2023
1a21e87
k
Ayvan77 Feb 16, 2023
8185a00
h
WILLY160116 Feb 16, 2023
f78c39b
A
Ayvan77 Feb 16, 2023
d85686e
Merge branch 'alopoder' of https://github.com/roncanciovl/Robot-over-…
Ayvan77 Feb 16, 2023
7aeebf4
pablesss
WILLY160116 Feb 16, 2023
d03f377
alo
RaulUrdaneta Feb 16, 2023
78bc79b
blesss
WILLY160116 Feb 16, 2023
7988783
hola
WILLY160116 Feb 16, 2023
8735e6e
ALo
Jacksiton Feb 16, 2023
34fe0b8
A12
Ayvan77 Feb 16, 2023
9c6b38d
h
WILLY160116 Feb 16, 2023
9ca27fe
Merge branch 'alopoder' of https://github.com/roncanciovl/Robot-over-…
WILLY160116 Feb 16, 2023
b7b0816
alo
RaulUrdaneta Feb 16, 2023
f4d794a
A13
Ayvan77 Feb 16, 2023
5180be4
jh
WILLY160116 Feb 16, 2023
7859745
f
WILLY160116 Feb 16, 2023
819a5dc
cambiosclase
WILLY160116 Feb 16, 2023
3acfc1b
New node
roncanciovl Feb 16, 2023
27b9081
hellou
WILLY160116 Feb 22, 2023
d6e930e
clasehoy
WILLY160116 Feb 23, 2023
f99394a
Settings in environment
roncanciovl Feb 28, 2023
439eb57
Change location in files
roncanciovl Feb 28, 2023
592df4b
Com
Mar 1, 2023
0a2df4b
Merge branch 'alopoder' of https://github.com/roncanciovl/Robot-over-…
Mar 1, 2023
84aa5dc
siuu
WILLY160116 Mar 2, 2023
b8fe354
Merge branch 'alopoder' of https://github.com/roncanciovl/Robot-over-…
WILLY160116 Mar 2, 2023
0c1a089
cambiosparaul
WILLY160116 Mar 9, 2023
5649673
reyessapo
WILLY160116 Mar 9, 2023
e010971
aloo
WILLY160116 Mar 15, 2023
ee5ce80
Created pkg lolito_interfaces
roncanciovl Mar 16, 2023
fe85b93
sapo
WILLY160116 Mar 16, 2023
d101f42
hola
WILLY160116 Mar 16, 2023
bb013fc
Merge branch 'alopoder' of https://github.com/roncanciovl/Robot-over-…
WILLY160116 Mar 16, 2023
6b263ea
Merge remote-tracking branch 'origin/test' into alopoder
WILLY160116 Mar 16, 2023
041d907
Merge remote-tracking branch 'origin/test' into alopoder
WILLY160116 Mar 16, 2023
812f72d
Merge branch 'alopoder' of https://github.com/roncanciovl/Robot-over-…
WILLY160116 Mar 16, 2023
3deccb5
sapobless
WILLY160116 Mar 22, 2023
44a2866
siuu
WILLY160116 Mar 22, 2023
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
87 changes: 86 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ Ref: https://docs.ros.org/en/foxy/Tutorials/Beginner-Client-Libraries/Creating-A
cd ~
```

4. Go to src folder in your workspace
4. Go to src folder in your workspace. Change my_name_ws accordingly

```shell script
cd my_name_ws/src/
Expand Down Expand Up @@ -55,6 +55,65 @@ sudo rosdep init
rosdep update
```

5. Open VSCode, got to the menu and select file, an then select open folder and select our workspace in home. This show our workspace in the VScode explorer

6. In a terminal go to your workspace

```shell script
colcon build
```

7. Sourve the overlay according to your distro

```shell script
source /opt/ros/foxy/setup.bash
```
8.

```shell script
. install/local_setup.bash
```


## Virtual Environment Setup in Linux

https://docs.ros.org/en/foxy/How-To-Guides/Using-Python-Packages.html

```shell script
sudo apt install python3-pip
```

```shell script
sudo apt install python3-virtualenv
```
### Make a virtual env and activate it

From your workspace directory run this command

```shell script
virtualenv -p python3 ./venv
```
```shell script
source ./venv/bin/activate
```

Make sure that colcon doesn’t try to build the venv
```shell script
touch ./venv/COLCON_IGNORE
```


Next, install the Python packages that you want in your virtual environment:

if any requirement file is in the src folder, then install them for command line

```shell script
pip install -r src/requirements.txt
```

Now you can build your workspace and run your python node that depends on packages installed in your virtual environment.



## Source Control Recommendations

Expand All @@ -66,3 +125,29 @@ rosdep update


BUENOS DIAS :)
ADIOS
hola willy
HOla reyes

feliz cumpleaños willy

GOLFITO





AMIGO BLESS CHIMBA
Paso por ti a las 2 ve arreglandote ;)
De medallo vea pues
JH

Feliz cumpleaños willito :)
Que rompa la piñata no
que la rompa raulito no
que la rompa carlitos no
que la rompa WIllyto
SIUUU

Hola chamito
hi
Empty file added henry_pkg/henry_pkg/__init__.py
Empty file.
33 changes: 33 additions & 0 deletions henry_pkg/henry_pkg/fis.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
import numpy as np
import skfuzzy as fuzz
from skfuzzy import control as ctrl

# New Antecedent/Consequent objects hold universe variables and membership
# functions
quality = ctrl.Antecedent(np.arange(0, 11, 1), 'quality')
service = ctrl.Antecedent(np.arange(0, 11, 1), 'service')
tip = ctrl.Consequent(np.arange(0, 26, 1), 'tip')

# Auto-membership function population is possible with .automf(3, 5, or 7)
quality.automf(3)
service.automf(3)

# Custom membership functions can be built interactively with a familiar,
# Pythonic API
tip['low'] = fuzz.trimf(tip.universe, [0, 0, 13])
tip['medium'] = fuzz.trimf(tip.universe, [0, 13, 25])
tip['high'] = fuzz.trimf(tip.universe, [13, 25, 25])

rule1 = ctrl.Rule(quality['poor'] | service['poor'], tip['low'])
rule2 = ctrl.Rule(service['average'], tip['medium'])
rule3 = ctrl.Rule(service['good'] | quality['good'], tip['high'])

rule1.view()

tipping_ctrl = ctrl.ControlSystem([rule1, rule2, rule3])

def main(args=None):
print()

if __name__ == '__main__':
main()
39 changes: 39 additions & 0 deletions henry_pkg/henry_pkg/my_pub.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
import rclpy
from rclpy.node import Node

from std_msgs.msg import String


class MinimalPublisher(Node):

def __init__(self):
super().__init__('minimal_publisher')
self.publisher_ = self.create_publisher(String, 'topic', 10)
timer_period = 0.5 # seconds
self.timer = self.create_timer(timer_period, self.timer_callback)
self.i = 0

def timer_callback(self):
msg = String()
msg.data = 'Hello World: %d' % self.i
self.publisher_.publish(msg)
self.get_logger().info('Publishing: "%s"' % msg.data)
self.i += 1


def main(args=None):
rclpy.init(args=args)

minimal_publisher = MinimalPublisher()

rclpy.spin(minimal_publisher)

# Destroy the node explicitly
# (optional - otherwise it will be done automatically
# when the garbage collector destroys the node object)
minimal_publisher.destroy_node()
rclpy.shutdown()


if __name__ == '__main__':
main()
55 changes: 55 additions & 0 deletions henry_pkg/henry_pkg/server.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,55 @@
import rclpy
from rclpy.node import Node
from sensor_msgs.msg import Image
from lolito_interfaces.srv import CaptureImage


class ImageCaptureServer(Node):
def __init__(self):
super().__init__('image_capture_server')
self.srv = self.create_service(CaptureImage, 'capture_image', self.capture_image_callback)

def capture_image_callback(self, request, response):
# Aquí es donde capturamos la imagen y la enviamos como respuesta
image = self.capture_image()
response.image = image
return response

def capture_image(self):
# En este ejemplo, utilizamos la biblioteca OpenCV para capturar la imagen
import cv2

# Capturamos la imagen de la cámara web
cap = cv2.VideoCapture(0)
_, frame = cap.read()

# Convertimos la imagen capturada a un mensaje ROS
msg = Image()
msg.header.frame_id = 'camera'
msg.encoding = 'bgr8'
msg.height, msg.width, _ = frame.shape
msg.step = 3 * msg.width
msg.data = frame.tobytes()

# Liberamos la cámara web
cap.release()

return msg


def main(args=None):
rclpy.init(args=args)

node = ImageCaptureServer()

try:
rclpy.spin(node)
except KeyboardInterrupt:
pass

node.destroy_node()
rclpy.shutdown()


if __name__ == '__main__':
main()
30 changes: 30 additions & 0 deletions henry_pkg/package.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
<?xml version="1.0"?>
<?xml-model href="http://download.ros.org/schema/package_format3.xsd" schematypens="http://www.w3.org/2001/XMLSchema"?>
<package format="3">
<name>henry_pkg</name>
<version>0.0.0</version>
<description>TODO: Package description</description>
<maintainer email="henryroncanciovelandia@gmail.com">roncanciovl</maintainer>
<license>Apache License 2.0</license>

<exec_depend>rclpy</exec_depend>
<exec_depend>std_msgs</exec_depend>
<exec_depend>sensor_msgs</exec_depend>
<exec_depend>example_interfaces</exec_depend>

<build_depend>rosidl_default_generators</build_depend>
<exec_depend>rosidl_default_runtime</exec_depend>
<member_of_group>rosidl_interface_packages</member_of_group>



<test_depend>ament_copyright</test_depend>

<test_depend>ament_flake8</test_depend>
<test_depend>ament_pep257</test_depend>
<test_depend>python3-pytest</test_depend>

<export>
<build_type>ament_python</build_type>
</export>
</package>
Empty file added henry_pkg/resource/henry_pkg
Empty file.
4 changes: 4 additions & 0 deletions henry_pkg/setup.cfg
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
[develop]
script-dir=$base/lib/henry_pkg
[install]
install-scripts=$base/lib/henry_pkg
27 changes: 27 additions & 0 deletions henry_pkg/setup.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
from setuptools import setup

package_name = 'henry_pkg'

setup(
name=package_name,
version='0.0.0',
packages=[package_name],
data_files=[
('share/ament_index/resource_index/packages',
['resource/' + package_name]),
('share/' + package_name, ['package.xml']),
],
install_requires=['setuptools'],
zip_safe=True,
maintainer='roncanciovl',
maintainer_email='henryroncanciovelandia@gmail.com',
description='TODO: Package description',
license='Apache License 2.0',
tests_require=['pytest'],
entry_points={
'console_scripts': [
'talker = henry_pkg.my_pub:main',
'imageServer = henry_pkg.server:main',
],
},
)
23 changes: 23 additions & 0 deletions henry_pkg/test/test_copyright.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
# Copyright 2015 Open Source Robotics Foundation, Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.

from ament_copyright.main import main
import pytest


@pytest.mark.copyright
@pytest.mark.linter
def test_copyright():
rc = main(argv=['.', 'test'])
assert rc == 0, 'Found errors'
25 changes: 25 additions & 0 deletions henry_pkg/test/test_flake8.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
# Copyright 2017 Open Source Robotics Foundation, Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.

from ament_flake8.main import main_with_errors
import pytest


@pytest.mark.flake8
@pytest.mark.linter
def test_flake8():
rc, errors = main_with_errors(argv=[])
assert rc == 0, \
'Found %d code style errors / warnings:\n' % len(errors) + \
'\n'.join(errors)
23 changes: 23 additions & 0 deletions henry_pkg/test/test_pep257.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
# Copyright 2015 Open Source Robotics Foundation, Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.

from ament_pep257.main import main
import pytest


@pytest.mark.linter
@pytest.mark.pep257
def test_pep257():
rc = main(argv=['.', 'test'])
assert rc == 0, 'Found code style errors / warnings'
1 change: 1 addition & 0 deletions install/.colcon_install_layout
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
isolated
Empty file added install/COLCON_IGNORE
Empty file.
Loading