<?xml version="1.0" encoding="utf-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom">
    <channel>
        <title>maroo.log</title>
        <link>https://velog.io/</link>
        <description>할수이따 ~</description>
        <lastBuildDate>Mon, 25 Sep 2023 13:38:34 GMT</lastBuildDate>
        <docs>https://validator.w3.org/feed/docs/rss2.html</docs>
        <generator>https://github.com/jpmonette/feed</generator>
        <image>
            <title>maroo.log</title>
            <url>https://images.velog.io/images/hwang-chaewon/profile/7b06bf6b-7b7f-4895-b14a-7d0d113d6bab/KakaoTalk_20220214_114538897.jpg</url>
            <link>https://velog.io/</link>
        </image>
        <copyright>Copyright (C) 2019. maroo.log. All rights reserved.</copyright>
        <atom:link href="https://v2.velog.io/rss/hwang-chaewon" rel="self" type="application/rss+xml"/>
        <item>
            <title><![CDATA[[ubuntu]terminator ]]></title>
            <link>https://velog.io/@hwang-chaewon/ubuntuterminator</link>
            <guid>https://velog.io/@hwang-chaewon/ubuntuterminator</guid>
            <pubDate>Mon, 25 Sep 2023 13:38:34 GMT</pubDate>
            <description><![CDATA[<p>sudo apt install terminator</p>
]]></description>
        </item>
        <item>
            <title><![CDATA[<실패>듀얼부팅 ubuntu 20.04 포맷 후 재설치]]></title>
            <link>https://velog.io/@hwang-chaewon/%EB%93%80%EC%96%BC%EB%B6%80%ED%8C%85-ubuntu-20.04-%ED%8F%AC%EB%A7%B7-%ED%9B%84-%EC%9E%AC%EC%84%A4%EC%B9%98</link>
            <guid>https://velog.io/@hwang-chaewon/%EB%93%80%EC%96%BC%EB%B6%80%ED%8C%85-ubuntu-20.04-%ED%8F%AC%EB%A7%B7-%ED%9B%84-%EC%9E%AC%EC%84%A4%EC%B9%98</guid>
            <pubDate>Wed, 23 Aug 2023 03:44:24 GMT</pubDate>
            <description><![CDATA[<p><a href="https://ubunlog.com/ko/reinstalar-ubuntu-ordenador/">https://ubunlog.com/ko/reinstalar-ubuntu-ordenador/</a>
이거대로 진행할건데 잘될지는....</p>
<p>1)USB에 20.04 image 굽기
image는 아래에서 ubuntu-20.04.6-desktop-amd64.iso 를 다운로드함
<a href="https://releases.ubuntu.com/focal/">https://releases.ubuntu.com/focal/</a>
<img src="https://velog.velcdn.com/images/hwang-chaewon/post/1a8d3f6f-54c2-4ab5-b6cf-aee3db66198e/image.png" alt=""></p>
<p>2)PC끄고 USB꽂은다음 재부팅 버튼(F10) 연타.
USB옵션을 선택해서 install ubuntu로 들어간다.
듀얼부팅 처음 세팅할때는 try ubuntu without install로 들어갔었는데, 여기는 install ubuntu로 들어가는 게 맞나? 잘못되면 어떡하지 싶긴한데.. 일단 해봄.</p>
<p>3)화면에서 install ubuntu로 들어가기</p>
<p>4)이것저것 설정. reinstall ubuntu 20.04가 핵심</p>
<p>실패함.
실패보다는.. 걍 안하기로 함.
이상한 화면밖에 안 나오는데 이건 좀 아닌거같음</p>
]]></description>
        </item>
        <item>
            <title><![CDATA[Window11에서 시간,날짜 숨기기]]></title>
            <link>https://velog.io/@hwang-chaewon/Window11%EC%97%90%EC%84%9C-%EC%8B%9C%EA%B0%84%EB%82%A0%EC%A7%9C-%EC%88%A8%EA%B8%B0%EA%B8%B0</link>
            <guid>https://velog.io/@hwang-chaewon/Window11%EC%97%90%EC%84%9C-%EC%8B%9C%EA%B0%84%EB%82%A0%EC%A7%9C-%EC%88%A8%EA%B8%B0%EA%B8%B0</guid>
            <pubDate>Mon, 24 Jul 2023 12:54:22 GMT</pubDate>
            <description><![CDATA[<p>요즘 멈출 수 없는 시간의 흐름이 너무 무서운 상태라 시간, 날짜를 숨기고 살고 싶다.
<img src="https://velog.velcdn.com/images/hwang-chaewon/post/949f1048-a320-44a3-b549-5738d6ae6971/image.png" width="30%" height="30%"></p>
<p>참고: 
<a href="https://www.mekan0.com/ko/how-to-hide-the-clock-and-date/">https://www.mekan0.com/ko/how-to-hide-the-clock-and-date/</a></p>
<h3 id="시간-숨기기">시간 숨기기</h3>
<p>원래 상태
<img src="https://velog.velcdn.com/images/hwang-chaewon/post/0d2a1b18-039f-45e8-8382-60a3f14f4a31/image.png" width="30%" height="30%">
아래와 같이 바꾸기: 간단한 시간-s
<img src="https://velog.velcdn.com/images/hwang-chaewon/post/bd2c7d63-e476-4df3-9ff3-7865278f0d66/image.png" width="30%" height="30%"></p>
<h3 id="날짜-숨기기">날짜 숨기기</h3>
<p>원래 상태
<img src="https://velog.velcdn.com/images/hwang-chaewon/post/0973c0d9-0028-492e-8891-c6298098a333/image.png" width="30%" height="30%">
아래와 같이 바꾸기: 간단한 날짜-ddd
<img src="https://velog.velcdn.com/images/hwang-chaewon/post/dc6656a2-b374-429a-a403-e1b52667bcbe/image.png" width="30%" height="30%"></p>
<p>이러면, 아래와 같이 시간과 날짜가 숨겨진다
<img src="https://velog.velcdn.com/images/hwang-chaewon/post/980c17d2-d408-4cda-8d0c-b051269cec8b/image.png" alt=""></p>
]]></description>
        </item>
        <item>
            <title><![CDATA[백준 1182: 부분수열의 합(C++)]]></title>
            <link>https://velog.io/@hwang-chaewon/%EB%B0%B1%EC%A4%80-1182-%EB%B6%80%EB%B6%84%EC%88%98%EC%97%B4%EC%9D%98-%ED%95%A9C</link>
            <guid>https://velog.io/@hwang-chaewon/%EB%B0%B1%EC%A4%80-1182-%EB%B6%80%EB%B6%84%EC%88%98%EC%97%B4%EC%9D%98-%ED%95%A9C</guid>
            <pubDate>Wed, 03 May 2023 03:09:42 GMT</pubDate>
            <description><![CDATA[<p><img src="https://velog.velcdn.com/images/hwang-chaewon/post/8ba2a91f-1b78-4b5c-8337-7ef227d48416/image.png" alt=""> <img src="https://velog.velcdn.com/images/hwang-chaewon/post/910b3e03-e9c5-4c28-9e3b-f6267504b4d7/image.png" alt=""></p>
<p>주어진 N개 숫자 중, 1개 이상을 뽑은 것의 합이 S가 되도록 한다. 이때 뽑은 부분수열의 개수를 구하는 문제이다.</p>
<h3 id="생각-흐름">생각 흐름</h3>
<p>N개 중 1개를 뽑아 합이 S가 되는 경우,
N개 중 2개를 뽑아 그 합이 S가 되는 경우,
...
N개 중 N개를 뽑아 그 합이 S가 되는 경우
이 모든 경우의 수를 count하면 된다.</p>
]]></description>
        </item>
        <item>
            <title><![CDATA[백준 11052: 카드 구매하기(C++)]]></title>
            <link>https://velog.io/@hwang-chaewon/%EB%B0%B1%EC%A4%80-11052-%EC%B9%B4%EB%93%9C-%EA%B5%AC%EB%A7%A4%ED%95%98%EA%B8%B0C</link>
            <guid>https://velog.io/@hwang-chaewon/%EB%B0%B1%EC%A4%80-11052-%EC%B9%B4%EB%93%9C-%EA%B5%AC%EB%A7%A4%ED%95%98%EA%B8%B0C</guid>
            <pubDate>Sat, 29 Apr 2023 07:13:39 GMT</pubDate>
            <description><![CDATA[<h3 id="생각-흐름">생각 흐름</h3>
<p>이런 식으로 하나하나 따져 봐야 하면서, 지금의 선택이 이전의 선택에 영향을 받는 류의 문제는 점화식을 세워서 푼다.
N개를 갖기 위해 지불해야 하는 금액의 최댓값을 f(N)이라고 보면,</p>
<pre><code>f(N)= P1          (if N=1)
    = Pk+f(N-k)   (if N!=1) (1&lt;=k&lt;=N)</code></pre><p>이라고 볼 수 있다.
( f(1), f(2), f(3) 등을 차례대로 구해 보면 저 공식이 자연스럽게 떠오를 것이다.)</p>
<p>지금의 선택값이 이전의 선택값에 영향을 받으므로 recursion을 활용하면 될 것이다.
결국 모든 것이 base condition으로 수렴할 텐데, base condition은 P1(if N=1)이다.</p>
<p>그런데 recursion의 경우 모든 걸 하나하나 따져 볼 때 시간과 메모리가 많이 들어간다.
f(N)을 구하려면 최대값인지를 알기 위해 모든 경우의 수를 base condition으로 수렴할 때까지 따져 볼 텐데, 거기서 다른 경우의 수에서 구해 놓은 값을 또 계산하는 경우가 많이 발생한다.</p>
<img src="https://velog.velcdn.com/images/hwang-chaewon/post/1205b669-4cf9-4618-b93c-630f8c330300/image.png" width="40%" height="40%">

<p>(위는 fibonacci 수열에 대한 예시이다. base condition인 모든 가지가 fibo(0)과 Fibo(1)까지 가기 위해 중간에 중복되는 값들을 계속 구하는 것을 볼 수 있다.)</p>
<p>따라서 어떤 f(k)값을 구한 다음 다른 배열에 저장을 해 놓는 과정이 필요하다.</p>
<h3 id="코드">코드</h3>
<pre><code>#include&lt;iostream&gt;
#include&lt;vector&gt;

using namespace std;

int record[1001] = {0,};
int maxn = 0;

int calc(int N, vector&lt;int&gt; p_i) {
    if (N == 0) { return 0; } //base condition: f(0)
    if (N == 1) { return p_i[1]; } //base condition: p_1

    for (int i = 1; i &lt;= N; i++) {
        if (record[N - i] == 0) {
            record[N - i] = calc(N - i, p_i); //recursion
        }
        maxn = (maxn &gt; p_i[i] + record[N - i]) ? maxn : p_i[i] + record[N - i];
    }
    return maxn;
}

int main() {
    ios::sync_with_stdio(0);
    cin.tie(NULL); cout.tie(NULL);

    int N; cin &gt;&gt; N;
    vector&lt;int&gt; p_i(N + 1);
    for (int i = 1; i &lt;= N; i++) { //index==i 되도록, p_0이 0이도록
        cin &gt;&gt; p_i[i];
    }

    cout &lt;&lt; calc(N, p_i);

    return 0;
}</code></pre>]]></description>
        </item>
        <item>
            <title><![CDATA[백준 11576: Base Conversion(C++)]]></title>
            <link>https://velog.io/@hwang-chaewon/%EB%B0%B1%EC%A4%80-11576-Base-ConversionC</link>
            <guid>https://velog.io/@hwang-chaewon/%EB%B0%B1%EC%A4%80-11576-Base-ConversionC</guid>
            <pubDate>Wed, 26 Apr 2023 07:09:57 GMT</pubDate>
            <description><![CDATA[<p><img src="https://velog.velcdn.com/images/hwang-chaewon/post/e7b6a4d2-b9e4-4494-97ee-40843fffa3e1/image.png" alt=""> <img src="https://velog.velcdn.com/images/hwang-chaewon/post/c4b41d1f-c4e4-493d-8c37-6f50bb57fdaa/image.png" alt=""></p>
<h3 id="생각-흐름">생각 흐름</h3>
<p>(1)A진법 수를 10진수로 변환
(2)10진수를 B진법 수로 변환</p>
<h3 id="코드">코드</h3>
<pre><code>#include&lt;iostream&gt;
#include&lt;vector&gt;
#include&lt;cmath&gt;
using namespace std;

int num_10 = 0;
vector&lt;int&gt; remain;

int main() {
    ios::sync_with_stdio(false);
    cin.tie(NULL); cout.tie(NULL);

    int A, B;
    cin &gt;&gt; A &gt;&gt; B;

    int N; cin &gt;&gt; N;

    vector&lt;int&gt; Anum(N);
    for (int i = N - 1; i &gt;= 0; i--) {
        cin &gt;&gt; Anum[i]; //거꾸로 넣기(10진수로 계산할때 index 편리하도록)
    }

    //A를 10진수로 바꾸기
    for (int i = 0; i &lt; N; i++) {
        num_10 += Anum[i] * pow(A, i);
    }

    //10진수를 B로 바꾸기
    while (num_10 &gt;= B) {
        remain.push_back(num_10 % B);
        num_10 = num_10 / B;
        if (num_10 &lt; B) {
            remain.push_back(num_10);
        }
    }

    for (int i = remain.size() - 1; i &gt;= 0; i--) {
        cout &lt;&lt; remain[i] &lt;&lt; &quot; &quot;;
    }

    return 0;
}</code></pre>]]></description>
        </item>
        <item>
            <title><![CDATA[백준 1935: 후위 표기식2(C++)]]></title>
            <link>https://velog.io/@hwang-chaewon/%EB%B0%B1%EC%A4%80-1935-%ED%9B%84%EC%9C%84-%ED%91%9C%EA%B8%B0%EC%8B%9D2C</link>
            <guid>https://velog.io/@hwang-chaewon/%EB%B0%B1%EC%A4%80-1935-%ED%9B%84%EC%9C%84-%ED%91%9C%EA%B8%B0%EC%8B%9D2C</guid>
            <pubDate>Mon, 24 Apr 2023 11:33:31 GMT</pubDate>
            <description><![CDATA[<p><img src="https://velog.velcdn.com/images/hwang-chaewon/post/ff744112-3f24-4c19-8bef-b95e6d25b619/image.png" alt=""><img src="https://velog.velcdn.com/images/hwang-chaewon/post/205da1fe-8fed-4974-abea-922dd0bfc997/image.png" alt=""></p>
<h3 id="생각-흐름">생각 흐름</h3>
<p>stack을 이용한다.
피연산자는 push하고, 연산자가 나오면 2개를 pop해 계산한 결과값을 push한다.
최종 stack에 남은 1개의 값이 결과값이다.</p>
<h3 id="초기-코드">초기 코드</h3>
<pre><code>#include&lt;iostream&gt;
#include&lt;algorithm&gt;
#include&lt;string&gt;
#include&lt;stack&gt;
using namespace std;

int main() {
    ios::sync_with_stdio(false);
    cin.tie(NULL); cout.tie(NULL);

    int N; cin &gt;&gt; N;
    string cmd; cin &gt;&gt; cmd;

    //수식에 입력 집어넣기
    char num;
    for (int i = 0; i &lt; N; i++) {
        cin &gt;&gt; num;
        replace(cmd.begin(), cmd.end(), (char)(i + 65), num);
    }

    //계산
    stack&lt;double&gt; stk;
    for (int i = 0; i &lt; cmd.size(); i++) {
        double A, B;
        //연산자 나오면 2개 pop해 계산해서 결과값 push 
        if (cmd[i] == &#39;+&#39;) {
            B = stk.top(); stk.pop();
            A = stk.top(); stk.pop();
            stk.push(A  + B);
        }
        else if (cmd[i] == &#39;-&#39;) {
            B = stk.top(); stk.pop();
            A = stk.top(); stk.pop();
            stk.push(A-B);
        }
        else if (cmd[i] == &#39;*&#39;) {
            B = stk.top(); stk.pop();
            A = stk.top(); stk.pop();
            stk.push(A* B);
        }
        else if (cmd[i] == &#39;/&#39;) {
            B = stk.top(); stk.pop();
            A = stk.top(); stk.pop();
            stk.push(A/B);
        }
        else { //피연산자는 push. 다만 char를 double로 바꿔서
            stk.push(double(cmd[i] - &#39;0&#39;));
        }
    }
    cout &lt;&lt; fixed; cout.precision(2);
    cout &lt;&lt; stk.top();
    return 0;
}</code></pre><h3 id="오류-틀렸습니다">오류: 틀렸습니다</h3>
<p>간과한 점: char는 오로지 1자리 값만 받는다.
10을 입력받는다면 1만 char에 저장된다.
--&gt;<em>수식에 입력을 치환해 놓지 말고, 알파벳 값이 들어오면 그때 상응하는 값으로 바꾸자!</em></p>
<h3 id="최종-코드">최종 코드:</h3>
<pre><code>#include&lt;iostream&gt;
#include&lt;algorithm&gt;
#include&lt;string&gt;
#include&lt;vector&gt;
#include&lt;stack&gt;
using namespace std;

int main() {
    ios::sync_with_stdio(false);
    cin.tie(NULL); cout.tie(NULL);

    int N; cin &gt;&gt; N;
    string cmd; cin &gt;&gt; cmd; //수식 받기

    //입력 숫자 받기
    vector&lt;int&gt; num; int n;
    for (int i = 0; i &lt; N; i++) {
        cin &gt;&gt; n;
        num.push_back(n);
    }

    //계산
    stack&lt;double&gt; stk;
    for (int i = 0; i &lt; cmd.size(); i++) {
        double A, B;
        //연산자 나오면 2개 pop해 계산해서 결과값 push 
        if (cmd[i] == &#39;+&#39;) {
            B = stk.top(); stk.pop();
            A = stk.top(); stk.pop();
            stk.push(A + B);
        }
        else if (cmd[i] == &#39;-&#39;) {
            B = stk.top(); stk.pop();
            A = stk.top(); stk.pop();
            stk.push(A - B);
        }
        else if (cmd[i] == &#39;*&#39;) {
            B = stk.top(); stk.pop();
            A = stk.top(); stk.pop();
            stk.push(A * B);
        }
        else if (cmd[i] == &#39;/&#39;) {
            B = stk.top(); stk.pop();
            A = stk.top(); stk.pop();
            stk.push(A / B);
        }
        else { //피연산자는 push
            stk.push(double(num[int(cmd[i] - 65)]));
        }
    }
    cout &lt;&lt; fixed; cout.precision(2);
    cout &lt;&lt; stk.top();
    return 0;
}</code></pre><h3 id="도움되었던-입력과-출력">도움되었던 입력과 출력</h3>
<p><strong>input</strong>
3
ABC++
10
20
30
<strong>output</strong>
60.00</p>
]]></description>
        </item>
        <item>
            <title><![CDATA[백준 10972: 다음 순열(C++)]]></title>
            <link>https://velog.io/@hwang-chaewon/%EB%B0%B1%EC%A4%80-10972-%EB%8B%A4%EC%9D%8C-%EC%88%9C%EC%97%B4C</link>
            <guid>https://velog.io/@hwang-chaewon/%EB%B0%B1%EC%A4%80-10972-%EB%8B%A4%EC%9D%8C-%EC%88%9C%EC%97%B4C</guid>
            <pubDate>Fri, 14 Apr 2023 09:00:11 GMT</pubDate>
            <description><![CDATA[<p><img src="https://velog.velcdn.com/images/hwang-chaewon/post/c720472f-4702-476d-b1df-c610ee697628/image.png" alt=""></p>
<h4 id="문제풀이-유형">문제풀이 유형</h4>
<p>순수 logic 짜기</p>
<h4 id="인간-의식의-흐름">인간 의식의 흐름</h4>
<p>예를 들어 1 2 3 4 6 5 를 본다면,
4까지는 멀쩡하다가 6부터 뭔가 흐름이 깨지네?
그리고 6과 5는 내림차순이네?
그러면 4를 이제 5로 바꾸고 뒤에는 4, 6을 순서대로 놔야겠다.</p>
<p>--&gt;
<em>앞에서부터 쭉 읽으면서, 처음으로 ++의 과정이 깨지는 곳(6)을 주시하고, 
그 다음에 뒤에서부터 쭉 읽으면서, 처음으로 (뒤에서부터의)오름차순이 깨지는 곳(4)을 본다.
4를 다음 오름차순(5)으로 바꾼 후, 5 뒤를 sort한다.</em></p>
<h3 id="코드-흐름">코드 흐름</h3>
<p>앞에서부터 봤을 때 처음으로 ++의 과정이 깨지는 곳은 코드 구현에서는 굳이 체크할 필요 없다.</p>
<p>뒤에서부터 쭉 읽으면서, 처음으로 오름차순이 깨지는 곳(B)을 본다.
B 오른쪽에서, B보다는 크면서 B오른쪽에서 가장 작은 수(다음 오름차순)와 B를 swap한다.
그 뒤 새로운 B의 뒤는 sort한다.</p>
<p>끝에서 처음까지 다 읽었는데도 오름차순이 깨지는 곳이 없다면 마지막 순열인 것이므로 -1을 출력한다.
단 N==1이라면 바로 -1을 출력한다.</p>
<h3 id="코드-오류-원인">코드 오류 원인</h3>
<p>logic을 왜곡함.
내가 생각한 인간 의식의 흐름을 코드로 그대로 구현했어야 하는데,
몇 개의 사례로 일반화해서 그 사례에만 맞는 코드를 짬.
사례에 맞는 코드를 짜지 말고, 일반화해서 전체 logic을 생각하기.</p>
<h3 id="전체-코드">전체 코드</h3>
<pre><code>#include &lt;iostream&gt;
#include&lt;vector&gt;
#include&lt;algorithm&gt;
using namespace std;

int main() {
    ios::sync_with_stdio(0);
    cin.tie(NULL); cout.tie(NULL);

    int N; cin &gt;&gt; N;
    vector&lt;int&gt; perm(N);

    for (int i = 0; i &lt; N; i++) {
        cin &gt;&gt; perm[i];
    }

    int i = N - 1;
    if (i == 0) { cout &lt;&lt; &quot;-1&quot;;  return 0; } //N==1일 때를 대비
    while (perm[i] &lt; perm[i - 1]) { //오름차순이 깨질 때까지 뒤에서부터 읽기
        i--;
        if (i == 0) { cout &lt;&lt; &quot;-1&quot;;  return 0; } //모두 읽는다면 마지막 순열이므로 -1 출력
    }

    int min = max_element(perm.begin()+i, perm.end())- perm.begin(); //다음 오름차순 초기화
    int j = i;
    for (; j &lt; N; j++) { //B 오른쪽에서 다음 오름차순 찾기: B보다는 크면서, 가장 작은 수
        if (perm[i-1] &lt; perm[j] &amp;&amp; perm[j] &lt; perm[min]) { min = j; }
    }
    swap(perm[i - 1], perm[min]); //swap
    sort(perm.begin() + i, perm.end()); //B의 오른쪽 sort

    for (int i = 0; i &lt; N; i++) {
        cout &lt;&lt; perm[i] &lt;&lt; &#39; &#39;;
    }

    return 0;
}</code></pre><h3 id="코드-수정에-도움되었던-입력과-출력">코드 수정에 도움되었던 입력과 출력</h3>
<p><strong>입력:</strong>
3
2 3 1
<strong>출력:</strong>
3 1 2</p>
<p><strong>입력:</strong>
1
1
<strong>출력:</strong>
-1</p>
<p><strong>입력:</strong>
7
1 7 3 2 4 6 5
<strong>출력:</strong>
1 7 3 2 5 4 6</p>
<p><strong>입력:</strong>
7
1 2 3 4 6 5 7
<strong>출력:</strong>
1 2 3 4 6 7 5</p>
<p><strong>입력:</strong>
4
2 1 4 3
<strong>출력:</strong>
2 3 1 4</p>
]]></description>
        </item>
        <item>
            <title><![CDATA[YOLO (v3) object detector in PyTorch: Part 5-Designing the input and the output pipelines]]></title>
            <link>https://velog.io/@hwang-chaewon/How-to-implement-a-YOLO-v3-object-detector-from-scratch-in-PyTorch-Part-5-Designing-the-input-and-the-output-pipelines</link>
            <guid>https://velog.io/@hwang-chaewon/How-to-implement-a-YOLO-v3-object-detector-from-scratch-in-PyTorch-Part-5-Designing-the-input-and-the-output-pipelines</guid>
            <pubDate>Thu, 10 Nov 2022 02:19:26 GMT</pubDate>
            <description><![CDATA[<p>Part5에서는 input에서부터 output까지의 pipeline을 구축한다. 
즉, <code>image 읽기--&gt;prediction--&gt;prediction을 이용해 image에 BB그리기--&gt;그 image 저장하기</code> 과정을 수행한다는 이야기다.
또한, 실시간으로 이 detector를 작동시키는 방법을 알아볼 것이다.</p>
<p>먼저, <code>detector.py</code> file을 만든다.</p>
<ul>
<li>pandas가 설치되어 있지 않아 <code>conda install pandas</code>로 pandas 설치<h3 id="creating-command-line-arguments">Creating Command Line Arguments</h3>
-<code>ArgParse</code> module을 이용해 detector에 command line argument를 전해 주는 function을 만든다.<h3 id="loading-the-network">Loading the Network</h3>
-COCO data의 label이 담긴<code>coco.names</code> file 다운받고 <code>data</code> 폴더 만들어서 넣기
-<code>util.py</code>에 <code>load_classes</code> 정의</li>
<li>label string을 담은 dictionary를 return하는 함수<h3 id="read-the-input-images">Read the Input images</h3>
-<code>util.py</code>에 <code>letterbox_image</code> 정의</li>
<li>image resize, aspect ratio 유지, padding
-<code>util.py</code>에 <code>prep_image</code> 정의<h3 id="create-the-batches">Create the Batches</h3>
<h3 id="the-detection-loop">The Detection Loop</h3>
-batch마다 detection에 걸린 time 측정</li>
<li>input을 받은 시간과, <code>write_results</code>의 output을 내기까지 사이의 시간
-<code>write_prediction</code>의 output attribute 중 하나는 batch에서 image의 index이다. 이를 <code>imlist</code>에서의 image index로 이용한다.<h3 id="drawing-bounding-boxes-on-images">Drawing bounding boxes on images</h3>
-output의 prediction은 padding image에 따른 상태지, original image에 대한 것이 아님.</li>
<li>따라서 BB를 그리기 전 original image의 dimension에 맞게 corner를 바꿔 주는 과정이 필요
-BB clip 코드 위에 <code>output_recast = time.time()</code> 추가<h3 id="printing-time-summary">Printing Time Summary</h3>
<h3 id="testing-the-object-detector">Testing The Object Detector</h3>
<pre><code>$ python detector.py --images dog-cycle-car.png --det det</code></pre>결과: 실패....net load는 됐는데 person이라고만 계속 나옴;;
detect 실패...로 video/webcam은 진행하지 않기로 함<h3 id="running-the-detector-on-videowebcam">Running the Detector on Video/Webcam</h3>
<h3 id="conclusion">Conclusion</h3>
</li>
</ul>
]]></description>
        </item>
        <item>
            <title><![CDATA[YOLO (v3) object detector in PyTorch: Part 4-Confidence Thresholding and Non-maximum Suppression]]></title>
            <link>https://velog.io/@hwang-chaewon/How-to-implement-a-YOLO-v3-object-detector-from-scratch-in-PyTorch-Part-4-Confidence-Thresholding-and-Non-maximum-Suppression</link>
            <guid>https://velog.io/@hwang-chaewon/How-to-implement-a-YOLO-v3-object-detector-from-scratch-in-PyTorch-Part-4-Confidence-Thresholding-and-Non-maximum-Suppression</guid>
            <pubDate>Thu, 10 Nov 2022 02:15:58 GMT</pubDate>
            <description><![CDATA[<h3 id="prerequisites">Prerequisites</h3>
<p>-우리의 output: B x 10647 x 85의 tensor</p>
<ul>
<li>B: batch 개수</li>
<li>10647: image당 예측한 BB 개수</li>
<li>85: BB attribute 개수
-true detection을 얻기 위해서는 output이 object score thresholding, non-maximal suppression을 거치도록 해야 함</li>
<li>이걸 위해 util.py에 write_results function 작성<h3 id="object-confidence-thresholding">Object Confidence Thresholding</h3>
-우리의 예측 tensor는 B x 10647 개의 BB에 대한 정보를 가진다.
-threshold아래의 objectness score를 가진 BB는 값을 0으로 만든다.<h4 id="note">Note</h4>
-IoU(Intersection over union): 객체 인식의 성능 평가를 하는 지표</li>
<li>어떤 영역들 사이에 intersection?: ground-truth와 proposed-region(prediction)<ul>
<li>ground truth: 우리가 정한 정답(미묘하게 다르긴 하지만, label같은 개념)
<img src="https://velog.velcdn.com/images/hwang-chaewon/post/bc54c6f9-fee8-422b-85fd-5efb9f964e41/image.png" alt=""></li>
<li>NMS(non-maximum supression): 한 가지 object에 많은 BB가 생기는데, 가장 score가 높은 박스만 남기고 나머지를 제거하는 승자독식 과정</li>
</ul>
</li>
<li>IoU값이 가장 큰 것을 남기는 과정인듯<h3 id="object-confidence-thresholding-1">Object Confidence Thresholding</h3>
<h3 id="performing-non-maximum-suppression">Performing Non-maximum Suppression</h3>
-bounding box attributes: 중심좌표, height, width</li>
<li>그런데, IoU를 계산하기 위해서는 BB의 꼭짓점 좌표를 이용하는 것이 편리함</li>
<li>(center x, center y, height, width)를 (top-left corner x, top-left corner y, right-bottom corner x, right-bottom corner y)로 transform
-각 image마다 true detection의 개수는 다를 수 있음</li>
<li>따라서 confidence thresholding, NMS는 별개 image마다 각각 수행해줘야 함(vectorize불가)</li>
<li><code>prediction</code>의 첫번째 요소만큼 iterate해줘야 함
-BB attributes중 class score가 max인 것 1개만 남기면 됨.</li>
<li>BB 85개의 row 중 class score에 해당하는 80row의 class score를 지우고, max값으로 바꿔준다.
-NMS</li>
<li>먼저 특정 class의 detection을 추출</li>
<li>NMS perform: bbox_iou function 사용<ul>
<li>bbox_iou
<img src="https://velog.velcdn.com/images/hwang-chaewon/post/2f9c2872-d8ce-4c0b-b10a-d369fe0d8680/image.png" alt=""><h4 id="calculating-the-iou">Calculating the IoU</h4>
<h3 id="writing-the-predictions">Writing the predictions</h3>
</li>
</ul>
</li>
</ul>
]]></description>
        </item>
        <item>
            <title><![CDATA[YOLO (v3) object detector in PyTorch: Part 3-Implementing the the forward pass of the network]]></title>
            <link>https://velog.io/@hwang-chaewon/How-to-implement-a-YOLO-v3-object-detector-from-scratch-in-PyTorch-Part-3-Implementing-the-the-forward-pass-of-the-network</link>
            <guid>https://velog.io/@hwang-chaewon/How-to-implement-a-YOLO-v3-object-detector-from-scratch-in-PyTorch-Part-3-Implementing-the-the-forward-pass-of-the-network</guid>
            <pubDate>Wed, 09 Nov 2022 03:48:57 GMT</pubDate>
            <description><![CDATA[<h3 id="defining-the-network">Defining The Network</h3>
<h3 id="implementing-the-forward-pass-of-the-network">Implementing the forward pass of the network</h3>
<p>-network의 forward pass: <code>nn.Module</code>의<code>forward</code> 메소드 사용</p>
<ul>
<li>forward의 역할(1): output 계산</li>
<li>forward의 역할(2): output detection map을 처리하기 쉽게 transform</li>
<li><code>forward</code>의 인자 3개: <code>self</code>, <code>x</code>, <code>CUDA</code><ul>
<li><code>CUDA</code>가 true일 경우 GPU사용<h4 id="convolutional-and-upsample-layers">Convolutional and Upsample Layers</h4>
<h4 id="route-layer--shortcut-layer">Route Layer / Shortcut Layer</h4>
<h4 id="yolo-detection-layer">YOLO (Detection Layer)</h4>
</li>
<li>YOLO의 output: BB의 attribute를 포함하는 convolutional feature map</li>
<li>predict_transform 함수를 통해 구현한다.</li>
</ul>
</li>
<li>predict_transform: util.py에 위치<h3 id="transforming-the-output">Transforming the output</h3>
-먼저 util.py의 import구문을 위한 cv2라이브러리 다운받기</li>
<li>pip install opencv-python</li>
<li>pip install opencv-contrib-python<ul>
<li>predict_transform 함수</li>
</ul>
</li>
<li>parameter 5개: prediction(output),inp_dim(input image dimension),anchors,num_classes,CUDA flag</li>
<li>detection feature map을 받아 2D tensor로 바꾼다<ul>
<li>tensor의 각 row가 BB의 attribute
<img src="https://velog.velcdn.com/images/hwang-chaewon/post/ebef5850-91c9-403d-b396-9b335341bf50/image.png" alt=""><h3 id="detection-layer-revisited">Detection Layer Revisited</h3>
</li>
<li>3개 scale의 detection map을 하나의 tensor로 concatenate<h3 id="testing-the-forward-pass">Testing the forward pass</h3>
</li>
<li>image를 YOLOv3폴더에 저장</li>
<li>에러 발생: <code>RuntimeError: shape &#39;[1, 255, 3025]&#39; is invalid for input of size 689520</code></li>
</ul>
</li>
<li>에러 해결: <a href="https://discuss.pytorch.org/t/shape-1-255-3025-is-invalid-for-input-of-size-689520/37603/11">https://discuss.pytorch.org/t/shape-1-255-3025-is-invalid-for-input-of-size-689520/37603/11</a> 참고<ul>
<li>get_test_input()에서는 img resize를 (416,416)으로 해주고 있는데, yolov3.cfg파일에서는 net의 input width, height가 608, 608임. yolov3.cfg의 width, height를 수정해 주니 작동됨
<img src="https://velog.velcdn.com/images/hwang-chaewon/post/3e5d469a-6873-4481-b0d9-0bcb371e32f8/image.png" alt=""></li>
<li>tensor의 shape: 1 x 10647 x 85</li>
</ul>
</li>
<li>1: batch size. image가 1개이므로</li>
<li>10647 x 85: 
-위 출력 결과는 random weight 상태로 출력된 것. official weight file을 사용하여 올바른 결과를 내야 함<h3 id="downloading-the-pre-trained-weights">Downloading the Pre-trained Weights</h3>
-yolov3.weights를 다운받아 YOLOv3폴더 안에 위치시키기<h3 id="understanding-the-weights-file">Understanding the Weights File</h3>
-yolov3.weights: weights를 순차적으로 저장한 binary file
-weights 형식</li>
<li>float</li>
<li>어떤 숫자가 어떤 layer의 것인지 명시되어 있지 않음
-weight 이해하기</li>
<li>두 layer중 하나에 속함: batch norm layer / convolutional layer</li>
<li>order: configuration file의 order와 같음
<img src="https://velog.velcdn.com/images/hwang-chaewon/post/27110b40-1817-4aaf-bbca-0d073e766785/image.png" alt=""><h3 id="loading-weights">Loading Weights</h3>
-에러 발생: <code>AttributeError: &#39;Darknet&#39; object has no attribute &#39;load_weights&#39;</code></li>
<li>에러 원인: 내가 load_weights 함수를 Darknet class에 넣지 않고 아예 바깥에 작성했음. 그러니 당연히 model.load_weights가 작동이 안 될 수밖에.</li>
<li>에러 해결: load_weights 함수를 Darknet class안에 넣는다.</li>
</ul>
]]></description>
        </item>
        <item>
            <title><![CDATA[YOLO (v3) object detector in PyTorch: Part 2-Creating the layers of the network architecture]]></title>
            <link>https://velog.io/@hwang-chaewon/How-to-implement-a-YOLO-v3-object-detector-from-scratch-in-PyTorch-Part-2-Creating-the-layers-of-the-network-architecture</link>
            <guid>https://velog.io/@hwang-chaewon/How-to-implement-a-YOLO-v3-object-detector-from-scratch-in-PyTorch-Part-2-Creating-the-layers-of-the-network-architecture</guid>
            <pubDate>Tue, 08 Nov 2022 00:38:40 GMT</pubDate>
            <description><![CDATA[<p>YOLO의 layer를 Pytorch를 이용해 구현하는 Chapter</p>
<h3 id="getting-started">Getting Started</h3>
<p>-detector code가 위치할 폴더 만들기</p>
<ul>
<li>나는 로컬에 programming/YOLOv3을 만듦
-darknet.py 파일 만들기</li>
<li>나는 VScode에서 YOLOv3을 들어가 파일 생성함</li>
<li>YOLO network를 만드는 파일
-util.py파일 만들기</li>
<li>YOLO network를 보충하는 파일. 여러 helper function이 포함돼 있음<h3 id="configuration-file">Configuration File</h3>
-cfg file: network의 layout 기술
-official cfg파일을 사용할 것. YOLOv3/cfg폴더 안에 저장하기</li>
<li>github에서 파일 다운받기: Raw버튼 클릭 후 Ctrl+S해서 원하는 폴더에 저장하기
-cfg파일을 살펴보면, YOLO에서 쓰이는 5가지 종류의 layer를 살펴볼 수 있다.<h4 id="1convolutional">(1)Convolutional</h4>
<h4 id="2shortcut">(2)Shortcut</h4>
<pre><code>[shortcut]
from=-3  
activation=linear  </code></pre>-shortcut layer=skip connection
-skip connection: 어떤 layer의 output을 몇 개를 건너뛴 layer의 input으로 연결하는 것
-from: 이 input이 얼마나 뒤에서 온 output인지<h4 id="3upsample">(3)Upsample</h4>
-bilinear upsampling<h4 id="4route">(4)Route</h4>
<pre><code>[route]
layers = -4
</code></pre></li>
</ul>
<p>[route]
layers = -1, 61</p>
<pre><code>-layers: 이 route layer를 위한 feature map output을 어느 index의 layer에서 뽑아낼 것인지
  - layer가 2개의 값: 2개의 값 concatenate
#### (5)YOLO
-이 YOLO layer가 detection layer를 말한다.
#### Net
-input과 parameter에 대한 설명
### Parsing the configuration file(parse_cfg())
-parsing: 파일을 단어단위로 분석하면서 어떤 정보인지를 알아낸 다음, 그 정보를 토대로 오브젝트를 실제로 만드는 것(파일은 오브젝트에 대한 명세일 뿐, 실제 그 오브젝트와 관련된 데이터를 직접적으로 담고 있지는 않음)
-darknet.py 상단에 다음 import문을 추가해 주자.</code></pre><p>from <strong>future</strong> import division</p>
<p>import torch 
import torch.nn as nn
import torch.nn.functional as F 
from torch.autograd import Variable
import numpy as np</p>
<pre><code>-parsing을 위해 parse_cfg 함수를 만들자.
  - cfg파일을 parsing하고, 각 block을 dict로 저장하는 함수
    - block의 attribute-value를 key-value로 저장
    - 1)cfg file 내용을 string list로 저장
    - 2)list를 loop
### Creating the building blocks(create_modules())
parse_cfg file에서 return받은 list를 이용해 Pytorch module을 만든다.
Pytorch는 5개 종류의 layer중 `convolutional`과 `upsample`은 기본으로 제공한다.
나머지 3종류는 nn.Module class를 이용하여 우리가 구현해야 한다.
그 구현 함수가 create_module이다.
net_info: network information store
#### nn.ModuleList
-nn.Module(a)을 object로 가지고 있는 list이다.
-이 nn.ModuleList를 nn.Module(b)의 object로 넣으면, nn.ModuleList안에 있는 nn.Module(a)의 parameter가 nn.Module(b)의 object로 들어간다.
-새로운 CN을 만들 때, 그 kernel의 dimension을 정해야 함. kernel의 depth=filter개수. prev_filter: layer에 있는 filter개수를 계속 저장해 둔다.
-preceding layer의 filter개수도 필요하다. output_filters list에 output filter의 개수를 계속 저장해 둔다.
-convolutional, upsample 구현
  - nn.Sequential, add_module통해 구현
#### Route Layer / Shortcut Layers
route, shortcut layer를 구현한다.
#### Wait, an empty layer?
-Pytorch에서 새로운 layer를 만들기: nn.Module object만들기--&gt;forward function쓰기
-새로운 Route layer만들기: layers를 포함한 nn.Module object만들기--&gt;forward function쓰기
#### YOLO Layer
### Testing the code
VScode의 터미널에서 먼저 
`conda install pytorch torchvision torchaudio cpuonly -c pytorch`
로 pytorch설치 후 Ctrl+F5
가상환경인 hcw_v에서 진행함.
![](https://velog.velcdn.com/images/hwang-chaewon/post/690b11fd-a417-4577-9e42-0c8deeea9ce2/image.png)
터미널에서 conda activate hcw_v를 할 뿐만 아니라,
우측 하단에서 인터프리터를 hcw_v로 바꿔줘야지 원활하게 가상 환경에서 실행이 된다.
실행되는 것을 확인했다.
![](https://velog.velcdn.com/images/hwang-chaewon/post/dda99284-b4c7-4482-8843-5d372296890c/image.png)</code></pre>]]></description>
        </item>
        <item>
            <title><![CDATA[YOLO (v3) object detector in PyTorch: Part 1-Understanding How YOLO works]]></title>
            <link>https://velog.io/@hwang-chaewon/How-to-implement-a-YOLO-v3-object-detector-from-scratch-in-PyTorch-Part-1-Understanding-How-YOLO-works</link>
            <guid>https://velog.io/@hwang-chaewon/How-to-implement-a-YOLO-v3-object-detector-from-scratch-in-PyTorch-Part-1-Understanding-How-YOLO-works</guid>
            <pubDate>Mon, 07 Nov 2022 14:44:30 GMT</pubDate>
            <description><![CDATA[<h2 id="what-is-yolo">What is YOLO?</h2>
<p>-You Only Look Once
-CNN로 학습한 feature로 object detect</p>
<h3 id="a-fully-convolutional-neural-network">A Fully Convolutional Neural Network</h3>
<p>-YOLO는 layer로 convolutional layer만 사용. 그러면서, FCN(fully CN)만 사용</p>
<ul>
<li>FCN이어서 input image의 size에 상관되지 않음<ul>
<li>그러나 batch돌릴 때의 편리함도 그렇고, 모든 image가 같은 height와 width를 가지는 게 여러모로 편리함</li>
</ul>
</li>
</ul>
<p>-CN 75개</p>
<ul>
<li>skip connection</li>
<li>upsampling layer</li>
<li>downsampling layer: feature map을 downsample시키는 stride 2의 CN<ul>
<li>stride: downsampling factor<ul>
<li>416Χ416 에서 stride가 32라면 output은 416/32=13Χ13임</li>
</ul>
</li>
</ul>
</li>
</ul>
<p><img src="https://velog.velcdn.com/images/hwang-chaewon/post/837ddcae-3c9b-45d1-b0a1-fc7b480d6c96/image.png" alt=""></p>
<h3 id="interpreting-the-output">Interpreting the output</h3>
<p>-CN에 의해 학습된 feature는 classifier/regressor로 감</p>
<ul>
<li>classifier/regressor: detection predict<ul>
<li>detection: bounding box의 좌표, class label 등</li>
<li>predict: 1Χ1 CN으로 수행</li>
<li>이 prediction의 output: feature map<ul>
<li>1Χ1 CN이므로 feature map size는 이전것과 똑같이 유지됨</li>
<li>이 map의 각 cell(=unit=neuron)은 일정 개수의 bounding box를 예측 가능</li>
<li>B*(5+C) entry를 가짐<ul>
<li>B: 각 cell이 예측가능한 BB개수<ul>
<li>B개의 BB가 한 종류의 object를 나타낼 수 있음</li>
<li>YOLO에서 B=3</li>
</ul>
</li>
<li>5+C: BB 1개가 가지는 attribute(중심좌표, 차원, objectness score, C(class confidence))</li>
</ul>
</li>
<li>object 중심이 cell의 receptive field에 들어온다면 그 cell들 1개당 object 1개를 predict할 것<ul>
<li>이를 위해, 1)이 BB가 어느 cell의 것인지 알아야 함<ul>
<li>그를 위해, input image를 최종 feature map과 같은 수치로 grid를 나눈다.</li>
<li>BB의 center가 위치한 cell이 그 object를 predict하는 cell이 된다.</li>
</ul>
</li>
<li>2)그 cell을 feature map에 detector로서 assign</li>
<li>3)그 cell(feature map의 것)은 3개의 BB예측 가능.<ul>
<li>3개 중 어느 BB가 truth label일까? 이를 알기 위해, anchor를 알아야 한다.</li>
</ul>
</li>
</ul>
</li>
</ul>
</li>
</ul>
</li>
</ul>
<p><img src="https://velog.velcdn.com/images/hwang-chaewon/post/46ad4ee3-2b7e-4f2d-8321-d971b9f1d3f8/image.png" alt=""></p>
<h3 id="anchor-boxes">Anchor Boxes</h3>
<ul>
<li>anchor: 예측하는 BB의 수치. <ul>
<li>Default BB를 기준으로 한 offset 또는 log-space transform</li>
</ul>
</li>
<li>YOLO v3: 3개의 anchor</li>
<li>truth label을 나타내는 BB는, 그 BB의 anchor가 ground truth box와 가장 많이 겹치는 IoU를 가지고 있는 경우이다.</li>
</ul>
<h3 id="making-predictions">Making Predictions</h3>
<p>-아래는 output이 prediction을 얻는 과정이다.
<img src="https://velog.velcdn.com/images/hwang-chaewon/post/96ea72f5-e85e-4697-b81f-adac599e0500/image.png" alt="">
-bx,by,bw,bh: 중심좌표 x, y, width, height
-tx,ty,tw,th: network output에서의 중심좌표 x, y, width, height
-cx,cy: grid의 왼쪽 상단 x,y좌표
-pw,ph: box의 anchor dimension</p>
<h4 id="중심-좌표">중심 좌표</h4>
<p>-sigmoid function을 통해 predict(output이 0~1이 되도록)
-보통 YOLO는 중심 좌표가 아닌 왼쪽 상단 좌표의 offset을 predict</p>
<h4 id="dimensions-of-the-bounding-box">Dimensions of the Bounding Box</h4>
<p><img src="https://velog.velcdn.com/images/hwang-chaewon/post/b8b164e6-b8cc-4cd5-8cd1-420929dc6e97/image.png" alt="">
-BB의 dimension: output에 log-space transform한 후 anchor곱하기
-결과 bw, bh: normalized된 것</p>
<h4 id="objectness-score">Objectness Score</h4>
<p>-object가 BB안에 있을 확률
-sigmoid를 거쳐감으로서 확률로 계산됨</p>
<h4 id="class-confidences">Class Confidences</h4>
<p>-그 class가 실제 object대로 분류됐을 확률 
-sigmoid 사용(non-exclusive class)</p>
<h3 id="prediction-across-different-scales">Prediction across different scales</h3>
<p>-YOLO는 3개의 다른 scale로 predict</p>
<p>-detection layer: detection을 3개의 다른 size로 수행</p>
<ul>
<li>stride가 각각 32,16,8</li>
<li>input image downsample--&gt;첫번째 detection layer(stride 32)에서 detect--&gt;upsampling by 2--&gt;이전 layer와 같은 수치를 가지는 feature map과 concatenate(합치기)--&gt;두번째 detect(stride 16)--&gt;upsampling by 2--&gt;final detection(stride 8)</li>
<li>각 detect마다, 각 cell은 3개의 anchor를 사용해 3개의 BB예측</li>
<li>1개의 cell이 총 9개의 BB예측
<img src="https://velog.velcdn.com/images/hwang-chaewon/post/f91b7d00-59fb-47d7-8fe0-1c1d217050e4/image.png" alt=""><h3 id="output-processing">Output Processing</h3>
-총 BB개수=((52x52)+(26x26)+(13x13))x3=10647
-그러나 object는 1개. 1개의 object에는 1개의 BB가 있어야 함. 10647개를 어떻게 1개로 만들 수 있을까?<h4 id="thresholding-by-object-confidence">Thresholding by Object Confidence</h4>
threshold objectness score보다 낮은 BB는 ignore<h4 id="non-maximum-suppressionnms">Non-maximum Suppression(NMS)</h4>
<img src="https://velog.velcdn.com/images/hwang-chaewon/post/3abff1e2-4b99-42c2-93f9-2a33f75eef15/image.png" alt=""><h3 id="our-implementation">Our Implementation</h3>
-detector로 official weight를 사용할 것
-weight: COCO dataset으로 train
-80개의 object 종류</li>
</ul>
]]></description>
        </item>
        <item>
            <title><![CDATA[[ROS1]]]></title>
            <link>https://velog.io/@hwang-chaewon/ROS1</link>
            <guid>https://velog.io/@hwang-chaewon/ROS1</guid>
            <pubDate>Wed, 05 Oct 2022 02:59:00 GMT</pubDate>
            <description><![CDATA[<p><a href="http://wiki.ros.org/melodic/Installation/Ubuntu">http://wiki.ros.org/melodic/Installation/Ubuntu</a></p>
<pre><code>$ sudo sh -c &#39;echo &quot;deb http://packages.ros.org/ros/ubuntu $(lsb_release -sc) main&quot; &gt; /etc/apt/sources.list.d/ros-latest.list&#39;
$ sudo apt install curl
$ curl -s https://raw.githubusercontent.com/ros/rosdistro/master/ros.asc | sudo apt-key add -
$ sudo apt update
$ sudo apt install ros-melodic-desktop-full
$ echo &quot;source /opt/ros/melodic/setup.bash&quot; &gt;&gt; ~/.bashrc</code></pre><p>if error&gt;&gt; </p>
<pre><code>$ source /opt/ros/melodic/setup.bash</code></pre><p>again</p>
<pre><code>$ sudo apt install ros-melodic-desktop-full 
$ source ~/.bashrc</code></pre><pre><code>$ sudo apt install python-rosdep python-rosinstall python-rosinstall-generator python-wstool build-essential
$ sudo apt install python-rosdep
$ sudo rosdep init
$ rosdep update</code></pre><pre><code>$ roscore
$ rosrun turtlesim turtlesim_node
$ rosrun turtlesim turtle_teleop_key</code></pre>]]></description>
        </item>
        <item>
            <title><![CDATA[[DR4R]라즈베리파이와 Jetson Nano의 이해]]></title>
            <link>https://velog.io/@hwang-chaewon/DR4R%EB%9D%BC%EC%A6%88%EB%B2%A0%EB%A6%AC%ED%8C%8C%EC%9D%B4%EC%99%80-Jetson-Nano%EC%9D%98-%EC%9D%B4%ED%95%B4</link>
            <guid>https://velog.io/@hwang-chaewon/DR4R%EB%9D%BC%EC%A6%88%EB%B2%A0%EB%A6%AC%ED%8C%8C%EC%9D%B4%EC%99%80-Jetson-Nano%EC%9D%98-%EC%9D%B4%ED%95%B4</guid>
            <pubDate>Sun, 02 Oct 2022 14:16:48 GMT</pubDate>
            <description><![CDATA[<p>한 마디로 <code>저가 컴퓨터</code>
가격을 낮추다 보니 키보드, 마우스, 모니터가 없는 연산에 치중한 컴퓨터
그래서 와이파이, 블루투스 기능을 추가한 제품도 있음.
컴퓨터니까!
라즈베리파이: 쉬운 확장성, 저렴한 가격, 가성비 때문에 유명해짐
<em>Q: 확장성이 좋다는 게 무슨 말? 확장 보드, expansion board와 연관 있나?</em></p>
<p>라즈베리파이의 2가지 사용 용도
(1)컴퓨터
-CPU, 메모리, 이더넷, 블루투스, 와이파이 기능
-웹서버, 파일 서버: 원격 제어 기능을 이용하면 모니터, 키보드 같은 IO장치 필요없이 보드만 전원에 연결되면 됨
(2)개발 보드
사물인터넷 프로젝트에 많이 쓰임</p>
<p>라즈베리파이의 구성 요소
컴퓨터의 주요 구성 요소와 같음
-SOC(System On Chip)---CPU, RAM(주기억장치), GPU
-microSD card slot(보드 뒷면에 위치): 컴퓨터의 하드 디스크 역할(데이터 저장, 운영체제 및 프로그램 설치)
Q: 하드 디스크가 뭔가? 실제 예시로. C, D 같은 건가?
-microUSB port: 보드 전원 공급
-HDMI port: TV나 모니터에 display 신호 보내기. 연결하면 화면 사용할 수 있음. 
(그러나 리눅스 운영체제 설치 후 원격기능으로 모니터 없이 사용 가능)
-오디오 port
-이더넷 port
-와이파이 기능: 무선 인터넷 사용 가능
-USB port: 다양한 USB와 연결하기 위해
-GPIO(General Purpose Input Output): 라즈베리 파이와 전자적으로 통신하기 위한 표준 port
<img src="https://velog.velcdn.com/images/hwang-chaewon/post/17a6d40b-fcd0-4175-8ee7-8901b619b3a9/image.png" alt=""></p>
]]></description>
        </item>
        <item>
            <title><![CDATA[[ubuntu 20.04]갤럭시 버즈 블루투스 연결]]></title>
            <link>https://velog.io/@hwang-chaewon/ubuntu-20.04%EA%B0%A4%EB%9F%AD%EC%8B%9C-%EB%B2%84%EC%A6%88-%EB%B8%94%EB%A3%A8%ED%88%AC%EC%8A%A4-%EC%97%B0%EA%B2%B0</link>
            <guid>https://velog.io/@hwang-chaewon/ubuntu-20.04%EA%B0%A4%EB%9F%AD%EC%8B%9C-%EB%B2%84%EC%A6%88-%EB%B8%94%EB%A3%A8%ED%88%AC%EC%8A%A4-%EC%97%B0%EA%B2%B0</guid>
            <pubDate>Sun, 02 Oct 2022 05:03:26 GMT</pubDate>
            <description><![CDATA[<pre><code>$ sudo apt update
$ sudo apt install blueman</code></pre><p>앱에 가서 블루투스 매니저 실행
<img src="https://velog.velcdn.com/images/hwang-chaewon/post/ba002760-130a-4d51-92c7-520e6426542b/image.png" alt="">
버즈 pair 후 connection</p>
<p>...</p>
<p>실패..pair가 connection abort때문에 안된댄다
리눅스는 진짜 화딱지 난다 블루맨 앱도 그냥 지웠다</p>
<p>!!아님! 해결함
갤럭시 버즈를 페어링 모드로 해서 일단 페어링을 해줘야 했다;;
<img src="https://velog.velcdn.com/images/hwang-chaewon/post/7e658d34-3225-49e4-8453-1116a66422ac/image.png" alt="">
이렇게 버즈를 페어링 모드로 진입시키면 페어링과 동시에 연결이 된다
<img src="https://velog.velcdn.com/images/hwang-chaewon/post/43c2fbfd-a11f-409b-90f8-40464f775a96/image.png" alt=""></p>
<p>그리고 사운드가 작아서 아래 글을 참고했더니 잘 됐다
<img src="https://velog.velcdn.com/images/hwang-chaewon/post/71e44887-809e-4c93-86d2-17ef215c5c14/image.png" alt=""></p>
]]></description>
        </item>
        <item>
            <title><![CDATA[[ubuntu]ros 버전 삭제]]></title>
            <link>https://velog.io/@hwang-chaewon/ubunturos-%EB%B2%84%EC%A0%84-%EC%82%AD%EC%A0%9C</link>
            <guid>https://velog.io/@hwang-chaewon/ubunturos-%EB%B2%84%EC%A0%84-%EC%82%AD%EC%A0%9C</guid>
            <pubDate>Sun, 02 Oct 2022 04:10:49 GMT</pubDate>
            <description><![CDATA[<p>$ sudo apt-get remove ros-noetic-*</p>
<p>삭제되었는지 확인 
$ rosversion -d </p>
]]></description>
        </item>
        <item>
            <title><![CDATA[[DR4R]4. Hardware course]]></title>
            <link>https://velog.io/@hwang-chaewon/DR4R4.-Hardware-course</link>
            <guid>https://velog.io/@hwang-chaewon/DR4R4.-Hardware-course</guid>
            <pubDate>Wed, 28 Sep 2022 07:40:14 GMT</pubDate>
            <description><![CDATA[<p>.</p>
]]></description>
        </item>
        <item>
            <title><![CDATA[[진행중][DR4R]3.Remote control course]]></title>
            <link>https://velog.io/@hwang-chaewon/%EC%A7%84%ED%96%89%EC%A4%91DR4R3.Remote-control-course</link>
            <guid>https://velog.io/@hwang-chaewon/%EC%A7%84%ED%96%89%EC%A4%91DR4R3.Remote-control-course</guid>
            <pubDate>Wed, 28 Sep 2022 07:26:15 GMT</pubDate>
            <description><![CDATA[<h2 id="1-app-robot-control">1. App robot control</h2>
<p>Android user인 나는 Google play store에서 Makercontrol App을 다운받는다.
<img src="https://velog.velcdn.com/images/hwang-chaewon/post/569e213d-8e15-4a47-9941-eab3b23b11e2/image.png" alt=""></p>
<h2 id="2-start-rosmaster-robot">2. Start ROSMASTER robot</h2>
<p>Yahboom image를 부팅한 robot을 연결.
<em>Q: 젯슨 나노 연결을 window에 연결해도 linux에 연결해도 상관X?</em></p>
<p>IP는, rosmaster가 부팅될때 나오는 IP를 넣어주면 연결이 될 것이다.
Jetson nano 4GB version system, username: <code>jetson</code>  password: <code>yahboom</code></p>
]]></description>
        </item>
        <item>
            <title><![CDATA[[디스크 관리]볼륨 확장]]></title>
            <link>https://velog.io/@hwang-chaewon/ubuntuOS-3%EA%B0%9C-%EB%A9%80%ED%8B%B0%EB%B6%80%ED%8C%85-ubuntu-20.04-ubuntu-18.04-window-11</link>
            <guid>https://velog.io/@hwang-chaewon/ubuntuOS-3%EA%B0%9C-%EB%A9%80%ED%8B%B0%EB%B6%80%ED%8C%85-ubuntu-20.04-ubuntu-18.04-window-11</guid>
            <pubDate>Sat, 24 Sep 2022 12:29:29 GMT</pubDate>
            <description><![CDATA[<p>D드라이브에서 110GB를 떼어냈다가, 취소하고 합쳐야 할 일이 생겼다.
<img src="https://velog.velcdn.com/images/hwang-chaewon/post/f2d4fdda-fd1c-4a3f-a85b-7307ee43daee/image.png" alt="">
Window+R &gt; diskmgmt.msc입력 &gt; D드라이브 우클릭&gt; 볼륨 확장 &gt; 109999 만큼의 공간 선택하면 원상복귀</p>
]]></description>
        </item>
    </channel>
</rss>