ROS

Allikas: Digilabor

Sisukord

ROSi kiirülevaade

ROS on Robotic Operating System lühend. Kui sa tead mis on IRC või interneti jututuba siis ROS ongi sarnane raamistik, kus on "kanalid" ning nende peals info avaldajad ning info tarbijad. See, mis infot täpselt seal liigutatakse, on igaühe enda teha. ROSi koosseisus on hulgaliselt kasutuskõlblikke asju nagu OpenCV, OpenDE, Player, Gazebo jne.

ROS paigaldus

Kasutasin lähtekoodist paigaldust kasutades lehekülge: http://www.ros.org/wiki/diamondback/Installation/Ubuntu/Source

Lisaks on oluline paigaldada see repo: tonu@hp:~/ros$ hg clone https://kforge.ros.org/robotmodel/visualization robot_model_visualizatation

ROSi miskid vidinad kiirelt käima

Avad kolm terminali ja nendes annad käsud:

roscore

tonu@hp:~$ roscore
... logging to /home/tonu/.ros/log/eeb7e150-5d10-11e0-8904-0013e8f6f8ff/roslaunch-hp-12007.log
Checking log directory for disk usage. This may take awhile.
Press Ctrl-C to interrupt
Done checking log file disk usage. Usage is <1GB.

started roslaunch server http://hp:45696/
ros_comm version 1.4.5

SUMMARY
========

PARAMETERS
 * /rosversion
 * /rosdistro

NODES

auto-starting new master
process[master]: started with pid [12021]
ROS_MASTER_URI=http://hp:11311/

setting /run_id to eeb7e150-5d10-11e0-8904-0013e8f6f8ff
process[rosout-1]: started with pid [12034]
started core service [/rosout]

rosrun

tonu@hp:~$ rosrun turtlesim turtlesim_node
[ INFO] [1301738606.120233875]: Starting turtlesim with node name /turtlesim
[ INFO] [1301738606.137276682]: Spawning turtle [turtle1] at x=[5.555555], y=[5.555555], theta=[0.000000]
tonu@hp:~$ rosrun turtlesim turtlesim_node
[ INFO] [1301738853.934837539]: Starting turtlesim with node name /turtlesim
[ INFO] [1301738853.943174214]: Spawning turtle [turtle1] at x=[5.555555], y=[5.555555], theta=[0.000000]

image:ROS_turtlesim1.png

rostopic

tonu@hp:~/ros$ rostopic list
/rosout
/rosout_agg
/turtle1/color_sensor
/turtle1/command_velocity
/turtle1/pose
tonu@hp:~/ros$ 
tonu@hp:~/ros$ rostopic echo /turtle1/pose -n 2
x: 5.55555534363
y: 5.55555534363
theta: 0.0
linear_velocity: 0.0
angular_velocity: 0.0
---
x: 5.55555534363
y: 5.55555534363
theta: 0.0
linear_velocity: 0.0
angular_velocity: 0.0
---
tonu@hp:~/ros$ 
tonu@hp:~/ros$ rosservice call /turtle1/teleport_relative 4 0

tonu@hp:~/ros$

image:ROS_turtlesim2.png

tonu@hp:~/ros$ rostopic echo /turtle1/pose -n 1
x: 9.55555534363
y: 5.55555534363
theta: 0.0
linear_velocity: 0.0
angular_velocity: 0.0
---
tonu@hp:~/ros$ 


tonu@hp:~$ rostopic list -v

Published topics:

* /turtle1/color_sensor [turtlesim/Color] 1 publisher
* /rosout [rosgraph_msgs/Log] 1 publisher
* /rosout_agg [rosgraph_msgs/Log] 1 publisher
* /turtle1/pose [turtlesim/Pose] 1 publisher

Subscribed topics:

* /turtle1/command_velocity [turtlesim/Velocity] 1 subscriber
* /rosout [rosgraph_msgs/Log] 1 subscriber

tonu@hp:~$

tonu@hp:~/ros$ rosrun turtlesim turtle_teleop_key
Reading from keyboard
---------------------------
Use arrow keys to move the turtle.

image:ROS_turtlesim3.png

Viled ja kellad

TF kasutamine

TF on ROSi abimees, mis aitab koordinaadisüsteemides ellu jääda. TF nimi peaks olema akronüüm "transform library"-st aga tasub ka tähele panna, et antud teegi autor on Tully Foote.

Hoolitseme, et kõik vanad ROSi protsessid enam ei töötaks ja käivitame demo:

tonu@hp:~/ros$ roslaunch turtle_tf turtle_tf_demo.launch
... logging to /home/tonu/.ros/log/64981c52-5d14-11e0-9f89-0013e8f6f8ff/roslaunch-hp-14677.log
Checking log directory for disk usage. This may take awhile.
Press Ctrl-C to interrupt
Done checking log file disk usage. Usage is <1GB.

started roslaunch server http://hp:48239/

SUMMARY
========

PARAMETERS
 * /turtle1_tf_broadcaster/turtle
 * /rosdistro
 * /scale_angular
 * /turtle2_tf_broadcaster/turtle
 * /rosversion
 * /scale_linear

NODES
  /
    sim (turtlesim/turtlesim_node)
    teleop (turtlesim/turtle_teleop_key)
    turtle1_tf_broadcaster (turtle_tf/turtle_tf_broadcaster.py)
    turtle2_tf_broadcaster (turtle_tf/turtle_tf_broadcaster.py)
    turtle_pointer (turtle_tf/turtle_tf_listener.py)

ROS_MASTER_URI=http://localhost:11311

core service [/rosout] found
process[sim-1]: started with pid [14695]
process[teleop-2]: started with pid [14696]
process[turtle1_tf_broadcaster-3]: started with pid [14697]
process[turtle2_tf_broadcaster-4]: started with pid [14698]
process[turtle_pointer-5]: started with pid [14699]
Reading from keyboard
---------------------------
Use arrow keys to move the turtle.

Nüüd saame nooleklahvide abil ühe kilpkonnaga ringi sõita ja teise ajab teda taga:

image:ROS_turtlesim4.png

Siin on tegemist erinevate koordinaatsüsteemidega. Kumbki kilpkonn asub platsil mingis absoluutses koordinaastikus aga teise kilpkonna üles leidmiseks on tarvis hoopis teada tema asukohta ENDA suhtes ning soovitavalt polaarkoordinaatides. Siin tuleb TF teenus appi.

tonu@hp:~/ros/geometry_tutorials/turtle_tf$ rostopic list
/rosout
/rosout_agg
/tf
/turtle1/color_sensor
/turtle1/command_velocity
/turtle1/pose
/turtle2/color_sensor
/turtle2/command_velocity
/turtle2/pose
tonu@hp:~/ros/geometry_tutorials/turtle_tf$ 
tonu@hp:~/ros/geometry_tutorials/turtle_tf$ rostopic echo /turtle2/command_velocity -n 1
linear: 3.11371368298e-05
angular: 1.39942315514e-07
---
tonu@hp:~/ros/geometry_tutorials/turtle_tf$ rostopic echo /turtle1/command_velocity -n 1
linear: 2.0
angular: 0.0
---
tonu@hp:~/ros/geometry_tutorials/turtle_tf$ 
tonu@hp:~/ros/geometry_tutorials/turtle_tf$ rostopic echo /turtle1/pose -n 1
x: 10.6129674911
y: 8.16536235809
theta: 0.70400005579
linear_velocity: 0.0
angular_velocity: 0.0
---
tonu@hp:~/ros/geometry_tutorials/turtle_tf$ 
tonu@hp:~/ros/geometry_tutorials/turtle_tf$ 
tonu@hp:~/ros/geometry_tutorials/turtle_tf$ rostopic echo /turtle2/pose -n 1
x: 10.612912178
y: 8.165350914
theta: 0.204018056393
linear_velocity: 2.82422879536e-05
angular_velocity: -3.07126327925e-07
---
tonu@hp:~/ros/geometry_tutorials/turtle_tf$ 
tonu@hp:~/ros/geometry_tutorials/turtle_tf$ rostopic echo /tf -n 2
transforms: 
  - 
    header: 
      seq: 0
      stamp: 
        secs: 1301741114
        nsecs: 120781898
      frame_id: world
    child_frame_id: turtle1
    transform: 
      translation: 
        x: 10.6129674911
        y: 8.16536235809
        z: 0.0
      rotation: 
        x: 0.0
        y: 0.0
        z: 0.344775892018
        w: 0.938685029327
---
transforms: 
  - 
    header: 
      seq: 0
      stamp: 
        secs: 1301741114
        nsecs: 121395111
      frame_id: world
    child_frame_id: turtle2
    transform: 
      translation: 
        x: 10.612912178
        y: 8.165350914
        z: 0.0
      rotation: 
        x: 0.0
        y: 0.0
        z: 0.101832205252
        w: 0.99480158925
---
tonu@hp:~/ros/geometry_tutorials/turtle_tf$ 

Tehnilises plaanis töötab TF niimoodi, et kuulutad oma koordinaadid /tf teema peal välja ning TF teenus puhverdab need arvud kümme sekundit ning oskab nende viimase kümne sekundi sees iga ajahetke kohta anda infot, et mis asendis üks vidin teise suhtes on. Käsurealt saab küsida nii:

tonu@hp:~/ros$ rosrun tf tf_echo
Usage: tf_echo source_frame target_frame

This will echo the transform from the coordinate frame of the source_frame
to the coordinate frame of the target_frame. 
Note: This is the transform to get data from target_frame into the source_frame.
tonu@hp:~/ros$ 
tonu@hp:~/ros/geometry_tutorials/turtle_tf$ 
tonu@hp:~/ros/geometry_tutorials/turtle_tf$ rosrun tf tf_echo turtle1 turtle2
At time 1301741361.829
- Translation: [-0.000, 0.000, 0.000]
- Rotation: in Quaternion [0.000, 0.000, -0.212, 0.977]
            in RPY [0.000, -0.000, -0.428]
At time 1301741362.812
- Translation: [-0.346, -0.002, 0.000]
- Rotation: in Quaternion [0.000, 0.000, -0.124, 0.992]
            in RPY [0.000, -0.000, -0.248]
At time 1301741363.830
- Translation: [-1.499, -0.010, 0.000]
- Rotation: in Quaternion [0.000, 0.000, 0.003, 1.000]
            in RPY [0.000, -0.000, 0.007]
At time 1301741364.832
- Translation: [-0.260, 0.847, 0.000]
- Rotation: in Quaternion [0.000, 0.000, -0.594, 0.804]
            in RPY [0.000, -0.000, -1.273]
At time 1301741365.825
- Translation: [0.239, 0.470, 0.000]
- Rotation: in Quaternion [0.000, 0.000, -0.852, 0.523]
            in RPY [0.000, -0.000, -2.041]
At time 1301741366.821
- Translation: [-1.475, 0.212, 0.000]
- Rotation: in Quaternion [0.000, 0.000, -0.147, 0.989]
            in RPY [0.000, -0.000, -0.295]
At time 1301741367.828
- Translation: [-0.350, -0.893, 0.000]
- Rotation: in Quaternion [0.000, 0.000, 0.563, 0.827]
            in RPY [0.000, -0.000, 1.195]
At time 1301741368.820
- Translation: [-1.268, -0.520, 0.000]
- Rotation: in Quaternion [0.000, 0.000, 0.328, 0.945]
            in RPY [0.000, -0.000, 0.668]
At time 1301741369.836
- Translation: [-1.119, -0.269, 0.000]
- Rotation: in Quaternion [0.000, 0.000, 0.120, 0.993]
            in RPY [0.000, -0.000, 0.241]
At time 1301741370.834
- Translation: [-1.881, -0.144, 0.000]
- Rotation: in Quaternion [0.000, 0.000, 0.057, 0.998]
            in RPY [0.000, -0.000, 0.113]
At time 1301741371.833
- Translation: [-1.970, -0.962, 0.000]
- Rotation: in Quaternion [0.000, 0.000, 0.276, 0.961]
            in RPY [0.000, -0.000, 0.560]
At time 1301741372.825
- Translation: [-1.588, -1.612, 0.000]
- Rotation: in Quaternion [0.000, 0.000, 0.418, 0.908]
            in RPY [0.000, -0.000, 0.863]
At time 1301741373.837
- Translation: [-2.429, -0.881, 0.000]
- Rotation: in Quaternion [0.000, 0.000, 0.203, 0.979]
            in RPY [0.000, -0.000, 0.409]
At time 1301741374.832
- Translation: [-1.984, -1.279, 0.000]
- Rotation: in Quaternion [0.000, 0.000, 0.355, 0.935]
            in RPY [0.000, -0.000, 0.725]
At time 1301741375.826
- Translation: [-0.188, -1.495, 0.000]
- Rotation: in Quaternion [0.000, 0.000, 0.751, 0.661]
            in RPY [0.000, -0.000, 1.699]
At time 1301741376.830
- Translation: [-1.336, -0.825, 0.000]
- Rotation: in Quaternion [0.000, 0.000, 0.308, 0.951]
            in RPY [0.000, -0.000, 0.626]
^CAt time 1301741377.598
- Translation: [-0.904, -0.549, 0.000]
- Rotation: in Quaternion [0.000, 0.000, 0.270, 0.963]
            in RPY [0.000, -0.000, 0.547]
tonu@hp:~/ros/geometry_tutorials/turtle_tf$

Kuidas tarkvarasse see sisse kirjutada, tuleb uurida lehelt http://www.ros.org/wiki/tf/Tutorials/Writing%20a%20tf%20broadcaster%20%28C%2B%2B%29 ning http://www.ros.org/wiki/tf/Tutorials/Writing%20a%20tf%20listener%20%28C%2B%2B%29


ROS ja Robotex 2011

Launch fail

See on siis fail, mis ROSile selgitab, millised muutujad on meile vajalikud ja mis teenused peab käiivtama:

<launch>
  <param name="ball_description" textfile="$(find phippi)/simple_sphere.urdf"/>
  <param name="robot_description" textfile="$(find phippi)/robot.urdf"/>
  <param name="gate1_description" textfile="$(find phippi)/gate1.urdf"/>
  <param name="gate2_description" textfile="$(find phippi)/gate2.urdf"/>
  <param name="border_upper" textfile="$(find phippi)/border_upper.urdf"/>
  <param name="border_upperleft" textfile="$(find phippi)/border_upperleft.urdf"/>
  <param name="border_upperright" textfile="$(find phippi)/border_upperright.urdf"/>
  <param name="border_lower" textfile="$(find phippi)/border_lower.urdf"/>
  <param name="border_lowerright" textfile="$(find phippi)/border_lowerright.urdf"/>
  <param name="border_lowerleft" textfile="$(find phippi)/border_lowerleft.urdf"/>

  <node pkg="tf" type="static_transform_publisher" name="tmp_broadcaster" args="1 -0.5 0 0 0 0 world base 500" />
  <node pkg="tf" type="static_transform_publisher" name="ball_broadcaster" args="-1 -0.5 0 0 0 0 world ball 500" />

  <node pkg="tf" type="static_transform_publisher" name="gate1_broadcaster" args="1.5 0 0 0 0 0 world gate1 500" />
  <node pkg="tf" type="static_transform_publisher" name="gate2_broadcaster" args="-1.5 0 0 0 0 0 world gate2 500" />

  <node pkg="robot_state_publisher" type="state_publisher" name="rob_st_pub" />
  <node name="joint_state_publisher" pkg="joint_state_publisher" type="joint_state_publisher" />

  <node pkg="phippi" type="phippi_motors_server" name="motors_server" output="screen"/>
  <node name="rviz" pkg="rviz" type="rviz" args="-d $(find phippi)/phippi.vcg" />
</launch>

Avaneb selline pilt:

Launch fail defineerib ära, meil on robot.urdf nimeline fail ja selles on meie roboti kuju kirjeldatud. Peamine eesmärk n teada roboti enda koordinaatsüsteem. Näiteks meie robotil on mingi keskpunkt, mille suhtes ta arvab ennast platsil positsioneerivat aga iga kaamera jaoks on X ja Y telje suund ning nullpunkt mujal. Kaheksa ringi kujuliselt paigutatud kaamera puhul on siis pilt selline:

Iga konkreetse roboti puhul on paigutus erinev. Antud roboti URDF faili sisu:

<robot name="phippi">
  <link name="base" >
    <visual>
      <origin xyz="0 0 0.12" rpy="0 0 0" />
      <geometry>
        <cylinder length="0.24" radius="0.17"/>
      </geometry>
        <material name="White">
          <color rgba="250 250 250 0.5"/>
        </material>
    </visual>
  </link>
  <link name="camera0" >
    <visual>
      <origin xyz="0 0 0" rpy="0 0 0" />
      <geometry>
        <box size="0.03 0.03 0.03" />
      </geometry>
    </visual>
  </link>
  <link name="camera1" >
    <visual>
      <origin xyz="0 0 0" rpy="0 0 0" />
      <geometry>
        <box size="0.03 0.03 0.03" />
      </geometry>
    </visual>
  </link>
  <link name="camera2" >
    <visual>
      <origin xyz="0 0 0" rpy="0 0 0" />
      <geometry>
        <box size="0.03 0.03 0.03" />
      </geometry>
    </visual>
  </link>
  <link name="camera3" >
    <visual>
      <origin xyz="0 0 0" rpy="0 0 0" />
      <geometry>
        <box size="0.03 0.03 0.03" />
      </geometry>
    </visual>
  </link>
  <link name="camera4" >
    <visual>
      <origin xyz="0 0 0" rpy="0 0 0" />
      <geometry>
        <box size="0.03 0.03 0.03" />
      </geometry>
    </visual>
  </link>
  <link name="camera5" >
    <visual>
      <origin xyz="0 0 0" rpy="0 0 0" />
      <geometry>
        <box size="0.03 0.03 0.03" />
      </geometry>
    </visual>
  </link>
  <link name="camera6" >
    <visual>
      <origin xyz="0 0 0" rpy="0 0 0" />
      <geometry>
        <box size="0.03 0.03 0.03" />
      </geometry>
    </visual>
  </link>
  <link name="camera7" >
    <visual>
      <origin xyz="0 0 0" rpy="0 0 0" />
      <geometry>
        <box size="0.03 0.03 0.03" />
      </geometry>
    </visual>
  </link>

  <joint name="joint0" type="continuous">
    <parent link="base"/>
    <child link="camera0"/>
    <origin xyz="0 0.09 0.24" rpy="0 0 0" />
    <axis xyz="0 0 1" />
  </joint>

  <joint name="joint1" type="continuous">
    <parent link="base"/>
    <child link="camera1"/>
    <origin xyz="0.0636396 0.0636396 0.24" rpy="0 0 5.497787144" />
    <axis xyz="0 0 0.7853981634" />
  </joint>

  <joint name="joint2" type="continuous">
    <parent link="base"/>
    <child link="camera2"/>
    <origin xyz="0.09 0 0.24" rpy="0 0 4.71238898" />
    <axis xyz="0 0 1.570796327" />
  </joint>

  <joint name="joint3" type="continuous">
    <parent link="base"/>
    <child link="camera3"/>
    <origin xyz="0.0636396 -0.0636396 0.24" rpy="0 0 3.926990817" />
    <axis xyz="0 0 3.926990817" />
  </joint>
  <joint name="joint4" type="continuous">
    <parent link="base"/>
    <child link="camera4"/>
    <origin xyz="0 -0.09 0.24" rpy="0 0 3.141592654" />
    <axis xyz="0 0 3.141592654" />
  </joint>

  <joint name="joint5" type="continuous">
    <parent link="base"/>
    <child link="camera5"/>
    <origin xyz="-0.0636396 -0.0636396 0.24" rpy="0 0 2.35619449" />
    <axis xyz="0 0 2.35619449" />
  </joint>

  <joint name="joint6" type="continuous">
    <parent link="base"/>
    <child link="camera6"/>
    <origin xyz="-0.09 0 0.24" rpy="0 0 1.570796327" />
    <axis xyz="0 0 4.71238898" />
  </joint>

  <joint name="joint7" type="continuous">
    <parent link="base"/>
    <child link="camera7"/>
    <origin xyz="-0.0636396 0.0636396 0.24" rpy="0 0 0.7853981634" />
    <axis xyz="0 0 5.497787144" />
  </joint>

</robot>

URDF faili formaadi kohta on alustuseks mõistlik lugeda siit


Kui uuesti launch fail ette võtta, siis seal seostatakse antud roboti mudel 3D maailmaga sellise rea abil:

  <node pkg="tf" type="static_transform_publisher" name="tmp_broadcaster" args="1 -0.5 0 0 0 0 world base 500" />

Tegemist on ROSi teenusega static_transform_publisher paketist TF, mis regulaarse intervalli tagant teatab mingid koordinaadid välja. Antud näite juures teatab ta iga 500 millisekundi tagant, et objekt "base" asub maailma suhtes X teljel asukohas 1 ja Y teljel -0.5. Z telje väärtus on null ning tagumised numbrid on Pitch/roll/yaw, mis lubavad mudelit igatpidi pöörata antud punktis.

Samal meetodil on 3D pildis paika pandud pall ja väravad.

Kuidas jõuda pallini ning siis lüüa pall väravasse? Käsurealt saab seda teha niimoodi. Esiteks, kuidas jõuda pallini? Küsime koordinaate objektide "base" ja "ball" vahel:

tonu@tonu-desktop:~/tyros/phippi/ros/phippi$ rosrun tf tf_echo /base /ball
At time 1302450478.066
- Translation: [-2.000, 0.000, 0.000]
- Rotation: in Quaternion [0.000, 0.000, 0.000, 1.000]
            in RPY [0.000, -0.000, 0.000]
At time 1302450479.066
- Translation: [-2.000, 0.000, 0.000]
- Rotation: in Quaternion [0.000, 0.000, 0.000, 1.000]
            in RPY [0.000, -0.000, 0.000]
^CAt time 1302450479.066
- Translation: [-2.000, 0.000, 0.000]
- Rotation: in Quaternion [0.000, 0.000, 0.000, 1.000]
            in RPY [0.000, -0.000, 0.000]
tonu@tonu-desktop:~/tyros/phippi/ros/phippi$ 

Ehk siis peame liikuma X telge pidi -2 ja olemegi palli juures. Kuidas pall lüüa väravasse 1? Küsime gate1 asukohta ball suhtes:

tonu@tonu-desktop:~/tyros/phippi/ros/phippi$ rosrun tf tf_echo /ball /gate1
At time 1302450565.101
- Translation: [2.500, 0.500, 0.000]
- Rotation: in Quaternion [0.000, 0.000, 0.000, 1.000]
            in RPY [0.000, -0.000, 0.000]
^CAt time 1302450567.590
- Translation: [2.500, 0.500, 0.000]
- Rotation: in Quaternion [0.000, 0.000, 0.000, 1.000]
            in RPY [0.000, -0.000, 0.000]
tonu@tonu-desktop:~/tyros/phippi/ros/phippi$ 

Ehk siis palli väravasse 1 saamiseks tuleb ta lennutada X teljel 2.5 ja Y teljel 0.5 suunas.

Muud teenused. Järgmised kaks rida on vajalikud selleks, et võetaks URDF failist välja meie roboti mudel ja antakse see ROSile teada. Pange tähele, et Launch failis tegelikult seati ainult püsti muutuja, mis meie faili nime teadis.

  <node pkg="robot_state_publisher" type="state_publisher" name="rob_st_pub" />
  <node name="joint_state_publisher" pkg="joint_state_publisher" type="joint_state_publisher" />

robot_state_publisher avaldab meie roboti faili sisu ROSis ning joint_state_publisher kasutab selle ära, et igale meie roboti külge pandud koordinaatidega asjale reaalsed numbrid sisse ilmuks reaalajas.

Viimane käsk on käivitada RVIZ, mis on 3D graafiline keskkond ja antakse talle ette ka konfiguratsioonifaili nimi:

  <node name="rviz" pkg="rviz" type="rviz" args="-d $(find phippi)/phippi.vcg" />

x

rosrun rviz rviz -d `rospack find turtle_tf`/rviz/turtle_rviz.vcg

Kaamerate kasutus

tonu@hp:~/ros/camera_umd/uvc_camera$ ./bin/camera_node 
opening /dev/video0
pixfmt 0 = 'YUYV' desc = 'YUV 4:2:2 (YUYV)'
  discrete: 640x480:   1/24 1/12 1/8 1/6 1/4 1/1 
  discrete: 352x288:   1/24 1/12 1/8 1/6 1/4 1/1 
  discrete: 320x240:   1/24 1/12 1/8 1/6 1/4 1/1 
  discrete: 176x144:   1/24 1/12 1/8 1/6 1/4 1/1 
  discrete: 160x120:   1/24 1/12 1/8 1/6 1/4 1/1 
  int (Brightness, 0, id = 980900): 0 to 255 (1)
  int (Contrast, 0, id = 980901): 0 to 255 (1)
  int (Saturation, 0, id = 980902): 0 to 100 (1)
  int (Hue, 0, id = 980903): -40 to 40 (1)
  int (Gamma, 0, id = 980910): 1 to 100 (1)
  menu (Power Line Frequency, 0, id = 980918): 0 to 2 (1)
    0: Disabled
    1: 50 Hz
    2: 60 Hz
  int (Sharpness, 0, id = 98091b): 0 to 31 (1)
  int (Backlight Compensation, 0, id = 98091c): 0 to 1 (1)
unable to set control: Invalid argument
ERROR: could not set some settings.  
 unable to set control 


Teises aknas:

tonu@hp:~$ rostopic list
/camera_info
/image_raw
/rosout
/rosout_agg
tonu@hp:~$ rosrun image_view image_view image:=image_raw


Debugime:

tonu@hp:~$ rostopic echo image_raw -n 1 | cut -b -1000
header: 
  seq: 2784
  stamp: 
    secs: 1301746315
    nsecs: 614286403
  frame_id: camera
height: 480
width: 640
encoding: rgb8
is_bigendian: 0
step: 1920
data: [116, 115, 119, 115, 114, 118, 110, 116, 116, 110, 116, 116, 110, 118, 117, 111, 119, 118, 111, 119, 120, 110, 118, 
---
tonu@hp:~$ 


tonu@hp:~/ros/common_msgs/sensor_msgs$ rosservice type /set_camera_info | rossrv show
sensor_msgs/CameraInfo camera_info
  Header header
    uint32 seq
    time stamp
    string frame_id
  uint32 height
  uint32 width
  string distortion_model
  float64[] D
  float64[9] K
  float64[9] R
  float64[12] P
  uint32 binning_x
  uint32 binning_y
  sensor_msgs/RegionOfInterest roi
    uint32 x_offset
    uint32 y_offset
    uint32 height
    uint32 width
    bool do_rectify
---
bool success
string status_message

tonu@hp:~/ros/common_msgs/sensor_msgs$
tonu@hp:~/ros/common_msgs/sensor_msgs$ rosservice call /set_camera_info  '{camera_info: {height: 480, width: 640}}'
success: True
status_message: ''
tonu@hp:~/ros/common_msgs/sensor_msgs$
Välja otsitud andmebaasist "http://digi.physic.ut.ee/mw/index.php/ROS"
Personaalsed tööriistad
Navigeerimine
Käsitöö